Elastic data packer

ABSTRACT

This disclosure relates to compressing and/or decompressing a group of similar data units, such as a table or queue of data units processed by a networking device or other computing apparatus. Each data unit in the group may only have values for fields in a master set. The described systems are particularly suited for hardware-level processing of groups of sparsely-populated data units, in which a large number of the data units have values for only a small number of the fields. In an embodiment, non-value carrying fields in a data unit are compressed based on a compression profile selected for the data unit. The compression profile indicates, for each master field, whether the compressed data unit includes a value for that field. Non-value carrying fields are omitted from the compressed data unit. The compression profile also permits compression of value-carrying fields using variable-width field lengths specified in the profile.

PRIORITY CLAIM

This application claims benefit under 35 U.S.C. §120 as a Continuationof application Ser. No. 14/843,524, filed Sep. 2, 2015, the entirecontents of which is hereby incorporated by reference as if fully setforth herein. Applicant hereby rescinds any disclaimer of claim scope inthe parent application(s) or the prosecution history thereof and advisethe USPTO that the claims in this application may be broader than anyclaim in the parent application(s).

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is related to U.S. patent application Ser. No.14/843,513, filed on Sep. 2, 2015, entitled “Elastic Data Unpacker,” byKumaran et al., the entire contents of which are hereby incorporated byreference for all purposes as if fully set forth herein.

TECHNICAL FIELD

Embodiments relate generally to hardware-level handling of compresseddata units.

BACKGROUND

The approaches described in this section are approaches that could bepursued, but not necessarily approaches that have been previouslyconceived or pursued. Therefore, unless otherwise indicated, it shouldnot be assumed that any of the approaches described in this sectionqualify as prior art merely by virtue of their inclusion in thissection.

Memory constraints are a performance bottleneck for many computingapparatuses, such as network routers, switches, and other infrastructuredevices. For example, a router may need to cache or store large tablesof packet headers, policies, attributes, instructions, or otherinformation. Adding additional memory and/or including higher-speedmemory in such apparatuses may increase their performance. However,there are a number of practical limitations to how much memory,higher-speed or otherwise, may be included in a computing apparatus.

In some cases, an alternative to increasing the amount of memory may beto store data in a compressed format within the available memory. Forexample, a general-purpose processor within the apparatus may beconfigured to compress the data before storing the data in memory byexecuting software-based instructions for any of a number ofconventional compression algorithms. The general-purpose processor maythen decompress the stored data as needed by executing software-basedinstructions for counterpart decompression algorithm(s). However,utilizing a general-purpose processor to execute a conventional softwaredecompression algorithm prior to processing the data may be costly froma performance-perspective, overly complex, and/or not optimal forcertain types of usage patterns.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings and in whichlike reference numerals refer to similar elements and in which:

FIG. 1 is an illustrative view of various aspects of an examplesubsystem for compressing data;

FIG. 2 illustrates a modified subsystem for compressing data units, inwhich compression profiles may be re-used for multiple packed dataunits;

FIG. 3 illustrates an example flow for compressing data units;

FIG. 4 illustrates an example process flow for compressing data unitsusing indexed profiles;

FIG. 5 is a block diagram illustrating an example packed data unit; and

FIG. 6 is a block diagram illustrating an example packed data unithaving variable length packed fields;

FIG. 7 is an illustrative view of various aspects of an examplesubsystem for decompressing packed data units;

FIG. 8 is an illustrative view of various aspects of another examplesubsystem for decompressing packed data units with reusable compressionprofiles;

FIG. 9 illustrates an example flow for decompressing packed data units;

FIG. 10 illustrates another example flow for decompressing packed dataunits;

FIG. 11 is an illustrative view of various aspects of an examplesubsystem for decompressing partially-packed data units;

FIG. 12 is a block diagram illustrating an example partially packed dataunit;

FIG. 13 is block diagram of a computer system upon which embodiments ofthe invention may be implemented.

DETAILED DESCRIPTION

In the following description, for the purposes of explanation, numerousspecific details are set forth in order to provide a thoroughunderstanding of the present invention. It will be apparent, however,that the present invention may be practiced without these specificdetails. In other instances, well-known structures and devices are shownin block diagram form in order to avoid unnecessarily obscuring thepresent invention.

Embodiments are described herein according to the following outline:

1.0. General Overview

2.0. Data Compression

-   -   2.1. Data Units    -   2.2. Profiles    -   2.3. Packed Data Unit    -   2.4. Advanced Profiling    -   2.5. Example Compression Process Flows    -   2.6. Example Packed Data Units

3.0. Data Decompression

-   -   3.1. Data Unpacker    -   3.2. Field Parser    -   3.3. Value Convertor    -   3.4. Profile Selector    -   3.5. Example Process Flows

4.0. Implementation Examples and Optimizations

-   -   4.1. Example Use Cases    -   4.2. Advanced Compression Schemes    -   4.3. Data Packer Example    -   4.4. Modular Data Packer    -   4.5. Example Data Unpacker    -   4.6. Partially-Packed Data Units    -   4.7. Pipelined Unpacker    -   4.8. Nested Unpackers    -   4.9. Parallel Unpackers    -   4.10. Multiple Data Unpackers    -   4.11. Genericized Data Units

5.0. Example Embodiments

6.0. Implementation Mechanism—Hardware Overview

7.0. Extensions and Alternatives

1.0. General Overview

Approaches, techniques, and mechanisms are disclosed for compressingand/or decompressing data structures referred to herein as “data units.”A data unit comprises data for any of a number of fields. Each fieldcorresponds to a different location within a data unit. Each field'sdata has a specified purpose. In an embodiment, each field—at least inuncompressed form—further has a fixed length, such as a specific numberof bits used to represent the data belonging to that field. In manycases, computing components that processes the data units are designedaround assumptions that the data in these fields will always be of therespective fixed field lengths.

The approaches, techniques, and mechanisms described herein are relevantto groups, or “arrays,” of similar data units. Each data unit in thearray may only have values for fields in a “master” set of fields. Thedescribed systems are particularly suited for processing arrays ofsparsely-populated data units, in which a large number of the data unitshave values for only a small number of the fields, and those fields mayvary from unit to unit. For instance, an array may be used to store dataunits representative of rules for routing network traffic. For any givenrule, there may be a number of fields for a large number of policies,attributes, actions, and so forth. However, for many rules, there mayonly be one or two relevant policies, and thus many of the data unitsmay only carry values in a handful of the defined fields.Conventionally, at the hardware level, if a data unit does not carry avalue for a field, the data unit is nonetheless required to store anempty or “null” value for that field, having the same fixed length asany other value for that field would. For instance, if a non-valuecarrying field has a fixed field length of 32 bits, the data unit may berequired to store 32 zeros in the field, or some other arbitrary 32 bitvalue designated as representing “null.”

According to an embodiment, memory may be saved when storing a data unitby compressing non-value carrying fields based on a compression profileselected for the data unit. The compression profile indicates, for eachfield in the master set, whether the compressed data unit includes avalue for that field. Non-value carrying fields may thus be omitted fromthe compressed data unit. The compressed data unit is also referred toherein as a packed data unit.

In an embodiment, the compression profile also permits compression ofvalue-carrying fields using variable-width field lengths specified inthe profile. Values that do not need to be represented using the fullfixed length of bits assigned to a field must typically be “padded” withextra zeros or other insignificant “filler” data so as to be of the fullfixed length. This padding may be removed for compression, and thecompression profile may specify the packed length of each field.

Because the data units in an array, though similar with respect to themaster set of fields, may nonetheless vary greatly with respect to whichfields actually carry values, different profiles may be used fordifferent data units in the array. For arrays where data units commonlyconform to a same subset of profiles, a table of the profiles may bestored. Each packed data unit may include a “compression profile index”that references its associated profile. In an embodiment, the selectionof a profile to associate with a data unit may be optimized to balanceminimizing the size of the packed data unit and limiting the number ofprofiles stored in the table.

According to an embodiment, a compression subsystem is implemented at ahardware level for “packing” uncompressed vectors, which are essentiallydata units such as described above. The compression subsystem may beimplemented, for instance, as one or more Field Programmable Gate Arrays(“FPGA”), Application Specific Integrated Circuits (“ASIC”), or otherspecialized circuitry within a computing device. The compressionsubsystem includes a profiler component that generates and/or otherwiseidentifies an appropriate profile for the uncompressed data unit. Thecompression subsystem further includes a data packer that inputs theidentified profile and the uncompressed data unit, and generates apacked data unit based thereon, in which field data is compressed in themanner described above. The packed data unit may be stored or forwardedto another component for further processing.

According to an embodiment, a decompression subsystem is implemented ata hardware level for “unpacking” data units in arrays that have beenpacked in the above manner. The decompression subsystem may beimplemented, for instance, as one or more Field Programmable Gate Arrays(“FPGA”), Application Specific Integrated Circuits (“ASIC”), or otherspecialized circuitry within a computing device. The decompressionsubsystem includes a profile selector component that identifies andinterprets a profile associated with each packed data unit. The profilemay be stored directly in association with the packed data unit, or inan entry within an indexed table that is referenced by the packed dataunit.

The profile information is provided with the packed data unit to an“unpacker” component. The unpacker component iteratively processes eachfield in the master set, in an order indicated by the profile. Theunpacker includes field outputs for each field in the master set, whichmay be routed to appropriate subsystems of the computing device inaccordance with their manner of usage. If the profile informationindicates that a field is not present, the unpacker outputs a nullvalue, or no value, to the corresponding field output. Otherwise, theunpacker parses a number of bits corresponding to the length of thepacked field from the front, back, or other identified location withinthe packed data unit, and sends the parsed value to the correspondingfield output. The process then repeats for the next field in the masterset.

According to an embodiment, an apparatus may include both one or morecompression subsystems for compressing and storing the original dataunits in packed form, and one or more decompression subsystems fordecompressing packed data units and outputting field data inuncompressed form, in accordance with the described techniques. However,in other embodiments, an apparatus need not necessarily comprise both acompression subsystem and a decompression subsystem. For instance, somedevices may only be configured to compress data, while others may onlybe configured to decompress data. Moreover, in some embodiments, thedescribed decompression subsystems may be used to decompress conformingdata units compressed through any suitable mechanism, and not just thosedescribed herein. Likewise, the data units produced by the describedcompression subsystems need not necessarily, in some embodiments, bedecompressed using the decompression mechanisms described herein.

2.0. Data Compression

FIG. 1 is an illustrative view of various aspects of an examplesubsystem 100 for compressing data, according to an embodiment.Subsystem 100 is configured to compress data units in an array of dataunits.

2.1. Data Units

Each data unit comprises data for any of a number of fields, which aredefined by master field specification 110. These fields are depicted asfields 112 a through 112 m, and referred to collectively as fields 112.

Each field 112 corresponds to a different location within each dataunit. The data stored within the location to which a field 112corresponds is defined to have a specific purpose associated with thefield 112. For instance, if the data units processed by subsystem 100were Internet Protocol (IP) headers, the master field specification 110would include separate fields 112 for a source IP address, a destinationIP address, protocol, and so forth. The techniques described herein areagnostic as to the specific purpose of any given field 112, but arerather concerned only with the fact that there is in fact a defined setof fields 112 for which each data unit may have data. The data unitsprocessed by subsystem 100 may only store data for some or all of fields112.

A master field specification 110 need not actually be stored or includedin subsystem 100, but is shown merely for illustrative purposes. In anembodiment, the master field specification 110 may be provided as inputat runtime, thus allowing the subsystem 100 to be adapted for differenttypes of data units 120. In another embodiment, the master fieldspecification 110 is hard-coded into system 100.

For illustrative purposes, subsystem 100 is depicted as processing anoriginal, uncompressed data unit 120. For each field 112, data unit 120comprises field data 122, depicted as individual subunits of field data122 a through 122 m that correspond to individual fields 112 a through112 m. More generally, an uncompressed data unit 120 may simply beconsidered a vector of bits, the bits being a concatenation of fielddata 122 a through 122 m. Certain subunits of field data 122 may bevalue-carrying, in that the subunit of field data 122 is considered torepresent a value that the data unit 120 assigns to the correspondingfield 112. Other subunits of field data 122 may be non-value-carrying,in that the data is considered to be invalid or insignificant for theassociated fields 112. A non-value carrying subunit of field data 122may be indicated by a value designated to be empty, invalid, or “null.”A specific value may be designated as null, or any value in which adesignated bit (e.g. a “validity” bit) is set (or not set) may beconsidered to be invalid. Or, non-value-carrying field data 122 may beindicated by associated metadata.

Though not depicted, in an embodiment, each data unit 120 may beassociated with descriptive metadata. This metadata may indicate, forinstance, which of fields 112 are valid (value-carrying) within the dataunit 120. This metadata may also or instead indicate, for each field112, the width of data (e.g. number of bits) found in the data unit 120for that field 112. This metadata may also or instead indicate whichbits in a given subunit of field data 122 carry valid or useful data.The metadata may be carried inside the data unit itself (e.g. in theupper or lower bits), or simply be carried by separate data that isprocessed in parallel with the data unit 120.

Although subsystem 100 may be agnostic as to the manner in which suchmetadata came into existence, the metadata may have, for example, beengenerated with the data unit 120, at a time when the data unit 120 wasplaced in a queue for processing by subsystem 100, or any timethereafter. The metadata may be generated based on a context in whichthe data unit 120 was generated or received, type data associated withdata unit 120, an analysis of the field data 122 within the data unit120, and so forth.

2.2. Profiles

Data unit 120, or metadata describing data unit 120, is accessed from amemory or some other source by profiler 130. Profiler 130 may, forexample, be implemented by one or more Field Programmable Gate Arrays(“FPGA”), Application Specific Integrated Circuits (“ASIC”), or otherspecialized circuitry within a computing device, or as software executedby a general purpose processor. Profiler 130 generates or identifies acompression profile 140 to associate with data unit 120. Compressionprofile 140, which may also be referred to as a packing profile,includes field state data 142 for at least each value-carrying field112. Each individual subunit of field state data 142 indicates, for acorresponding field 112, information about what the state of the field112 should be when compressed by the subsystem. For instance, fieldstate data 142 a may reflect the state of field 112 a within a packeddata unit 180 for data unit 120.

A given subunit of field state data 142 may indicate, for instance,whether or not a corresponding field 112 will be present within thepacked data unit 180. In some embodiments, a positive or negativeindication is specified for each possible field 112. In otherembodiments, the omission of state data 142 for a field 112 implies thatthe field 112 will not be present within the packed data unit 180.

In an embodiment, the state data 142 may further specify a length of thefield in the packed data unit 180, also referred to as a “packedlength.” This length is typically equal to or slightly more than theminimum number of bits required to represent the value of the field(e.g. the number of bits left after removing any leading zeros). In someembodiments, the profile 140 may indicate that data is present for afield 112 simply by specifying a non-zero packed length. In otherembodiments, a separate bit may be used to indicate the presence of datafor a field 112, as value-carrying data for certain types of fields 112may theoretically be packed to a zero length, or such a bit may bedesirable for optimization reasons. In other embodiments, the datalengths of some or all of the fields 112 may remain the same whenpacked, and thus need not be specified by the profile.

Profile 140 generally functions to indicate location information forlocating the data for each field 112 that is to be present within thepacked data unit 180. Profile 140 may thus be considered to include someform of extraction location information that indicates what data toextract from data unit 120 and place in the packed data unit 180. Anumber of examples of extraction location information that may besuitable in different embodiments are given throughout this disclosure,including field state data 142, instruction sets, container-basedextraction location information, and so forth.

In embodiments illustrated by the example depicted in FIG. 1, the fieldstate data 142 of the profile 140 is required to be arranged in the sameorder as the packed field data within packed data unit 180, so as tosimplify the process of locating the data once packed inside packed dataunit 180. This order may or may not be the same order as the order inwhich the field data 122 of the original data unit 120 was arranged. Forinstance, in the depicted example, the location information is indicatedby a combination of the field ordering, information in the state data142 indicating whether a field is present, and either the lengthinformation specified in the state data 142 for a field, or the fixedlength information for the field, depending on the embodiment. Theordering requirement need not be universal across embodiments, though. Aprofile may indicate location information in a variety of other manners,including manners which allow for discernment of the location of thefield data without strictly requiring that the field state data 142 bearranged within the profile 140 in the same order as the correspondingpacked field data in packed data unit 180. For example, the field statedata 142 that indicates the presence of a field 112 within the packeddata unit 180 may also specify a sequence number for the field 112within the packed data unit 180.

In an embodiment, field state data 142 takes the form of a group ofinstruction sets to extract bits from the data unit 120 for packing intothe packed data unit 180. Each instruction set corresponds to adifferent field 112. For a data unit 120 containing M fields, there arethus M sets of the above information stored in the profile 140. Aninstruction set includes a field start offset, which is the offset intothe vector where a field begins (e.g. expressed as a number of bits).The instruction set further includes a field extraction offset, which isan offset into the field to extract bits. The instruction set furtherincludes a field extraction length, which is the length of bits toextract, starting at the field extraction offset. A length of zero meansno bits are extracted for the field. The instruction set furtherincludes a target offset, which is a target offset (i.e. location) intothe packed data unit where the extracted bits are to be written.

In another embodiment, it is also possible to condense the informationstored in the profile by having instruction sets only for the fields 112or field segments that will be extracted. For a vector containing Mfields, if bits from only Q fields need to be extracted, then there areQ sets of the above information stored in the profile 140. Eachinstruction set need include only an extraction offset, extractionlength (starting at the extraction offset), and target offset. In yetother embodiments, the target offset may be implied from field orderinginformation combined with field or extraction length information. Forinstance, the target offset may be inferred from the running sum of eachfield's extraction length. In embodiments, an instruction set mayspecify bits to ignore rather than bits to extract, though such data isstill considered to indicate an extraction offset and extraction lengthfor the purposes of this disclosure.

In some embodiments, the field state data 142 may include otherinformation. For instance, the field state data 142 may indicate how thevalue(s) for a certain field(s) 112 should be unpacked or decompressed,in embodiments where multiple compression/decompression mechanisms areavailable. For example, the field state data 142 may indicate that agiven field should be compressed and/or decompressed using a specificlossless compression algorithm. Non-limiting examples of specific typesof advanced compression schemes that may be specified by a profile 140are given in other sections.

2.3. Packed Data Unit

Subsystem 100 further comprises a data packer 150. Like profiler 130,data packer 150 may, for example, be implemented by one or more FieldProgrammable Gate Arrays (“FPGA”), Application Specific IntegratedCircuits (“ASIC”), or other specialized circuitry within a computingdevice, or as software executed by a general purpose processor. Whiledepicted as separate logical components for illustrative purposes, insome embodiments profiler 130 and packer 150 are a single, integratedcomponent.

Data packer 150 accepts as inputs the data unit 120 and profile 140.Based on the state data 142, data packer 150 converts data unit 120 intopacked data unit 180, and stores the packed data unit 180 in anappropriate packed data unit array 170, or passes the packed data unit180 on to a next processing component. The appropriate data unit array170 or next processing unit may be fixed, a function of the identifiedprofile, a function of a specific field 112, a function of associateddescriptive metadata, and so forth.

A packed data unit array 170 comprises multiple packed data units 180,depicted as 180 a through 180 x. Each packed data unit includes acompression profile 140 and packed field data. The packed data unitarray 170 may be stored in any suitable memory 160, such as a RandomAccess Memory (RAM), registers, and so forth. An array 170 may buffer orqueue packed data units 180 for subsequent processing, or store packeddata units 180 for an indefinite period of time, such as for deviceconfiguration or data storage.

In general, the packed field data generated by data packer 150 removesfield data 122 for any non-value-carrying field in data unit 120, andoptionally condenses the field data 122 for any value-carrying field tothe length specified by the profile 140.

The foregoing may be accomplished using a variety of specificimplementations, depending on the embodiment. For instance, generatingthe packed data unit may involve initializing a number of bits, equal insize to the width expected of the packed data unit 180, to a predefinedvalue. The expected size of the packed data unit 180 is the sum of allthe extraction lengths in a profile. The initialized bits may all beinitialized to zero, for instance. Based on the field state data 142(e.g. instruction sets), data packer 150 may perform a group of bitwiseoperations on the initialized packed data unit, with respect to theinputted uncompressed data unit 120, to generate the final packed dataunit 180. Data packer may perform such operations entirely in a series,or break the data unit 180 into parallel components against which suchoperations are performed in parallel. Although a variety ofimplementations are possible, specific examples are given in othersections of this disclosure.

In some embodiments data packer 150 may be configured to performadditional steps such as rearranging the field data 122 to match anorder indicated by the profile 140, or compressing a value using a moresophisticated algorithm indicated by the profile. While the additionaloverhead of compressing and decompressing the value using a moresophisticated algorithm may be undesirable in certain embodiments, thereare nonetheless other embodiments where the overhead may be acceptable.Any suitable lossless compression algorithm may be used.

2.4. Advanced Profiling

FIG. 2 illustrates a modified subsystem 200 for compressing data units,in which compression profiles may be re-used for multiple packed dataunits, according to an embodiment. FIG. 2 comprises many componentssimilar to those found in FIG. 1. For instance, FIG. 2 includes dataunits 220, profiler 230, data packer 250, memory 260, and packed dataunit array 270, which are analogous to data unit 120, profiler 130,packer 150, memory 160, and packed data unit array 170, respectively.

However, subsystem 200 further stores a compression profile array 245,which may be stored in any suitable memory, including memory 260.Compression profile array 245 comprises a plurality of indexed profiles240 a through 240 p, collectively referred to as compression profiles240. Compression profiles 240 are analogous to profiles 140 in FIG. 1,except that they are also each associated with an index number by whichthey may be respectively referenced.

Packed data unit array 270 stores packed data units 280 a through 280 x,collectively referred to as packed data units 280. Packed data units 280are analogous to packed data units 180, except that instead of includinga compression profile 140, the packed data units 280 include an indexnumber that refers back to an associated profile 240 in the compressionprofile array 245.

In an embodiment, profiler 230 is configured to generate profiles 240 inthe same manner as profiler 130. When a generated profile 240 is notalready in the array 245, profiler 130 adds the profile 240 to the array245. Profiler 130 provides the index associated with the profile 240 tothe data packer 250.

In an embodiment, before generating a new profile 240 for a data unit220, profiler 230 may instead be configured to determine whether asuitable profile 240 already exists for the data unit 220. The suitableprofile 240 need not be an optimal profile for compressing the data unit220, but rather may be chosen so long as it compresses the data unit 220at an acceptable level. For instance, in an embodiment, the profiler 130may calculate or predict the optimal compressed length of the packeddata 280 for the data unit 220. If a profile 240 would produce a packeddata unit 280 whose length is within a certain threshold of that optimallength, the profile 240 may be used.

In such embodiments, the heuristic used to determine when to match anexisting profile 240 to a data unit 220 as opposed to when to generate anew profile 240 may be fine-tuned to balance between objectives such asreducing the size of the array 245, reducing the complexity of theprofiler 230, and/or reducing the sizes of the packed data units 280.Moreover, the heuristic used to generate a new profile 240 for a dataunit 220 may likewise be optimized for these objectives, rather thanalways producing a packed data unit of optimal size.

For instance, a certain field may have values that may be representedusing anywhere from 1 to 255 bits. If left to create profilesindiscriminately, the profiler 130 might create 256 different profiles.The number of profiles would rise exponentially for each such field inthe master set. Instead, the profiler may be configured to only createprofiles having lengths that are multiples of 4, 16, or some othersuitable number, thus reducing the complexity of the compression profilearray to a manageable size.

In another embodiment, a predefined set of profiles 240 may always beused, and profiler 130 may never actually create a new profile 240. Inyet another embodiment, profiles may be constrained to certaincombinations of fields using various predefined combination rules orlogic. For instance, there may be a Profile P that includes Fields A, B,C, and D. A data unit may only have values for Fields A, B, and D.However, due to constraints on field combinations, Profile P would beused to compress the data unit rather than creating a new profile forthe combination of A, B, and D. Hence, the packed data unit wouldinclude an empty field C.

In an embodiment, profiler 130 includes a profile selector that selectsan applicable profile from a set of predefined profiles. The profileselector may be, for instance, implemented as a Ternary ContentAddressable Memory (TCAM) or other matching algorithm on descriptivemetadata associated with the data unit 120. In an embodiment, ratherthan outputting a profile itself, the profile selector outputs a tagthat is stored in association with, or propagated with, the packed dataunit 180. For instance, the tag can be a pointer to a stored profile ina profile table. Or, the tag can be a type indicator for the packed dataunit. The tag may then be used by a subsequent data unpacker componentto retrieve the appropriate profile. Throughout the disclosure, anyreference to components inputting a profile should be understood asequally referring to components inputting such a tag and locating thereferenced profile based thereon.

In an embodiment, the tuple {type, packed data unit} may be used as amatch value in a subsequent TCAM lookup or exact match table lookup fordetermining how to further process or interpret the packed data unit.For instance, the type specified by a tag may indicate to a subsequentprocessing unit how to interpret the packed data unit. The subsequentprocessing unit can perform any of a number of different functions withrespect to the packed data unit, such as classification, routing,further compression, and so forth.

2.5. Example Compression Process Flows

FIG. 3 illustrates an example flow 300 for compressing data units,according to an embodiment. The various elements of flow 300 may beperformed in a variety of systems, including systems such as systems 100and 200 described above. In an embodiment, each of the processesdescribed in connection with the functional blocks described below maybe implemented using one or more computer programs, other softwareelements, and/or digital logic in any of a general-purpose computer or aspecial-purpose computer, while performing data retrieval,transformation, and storage operations that involve interacting with andtransforming the physical state of memory of the computer.

Block 305 comprises accessing the first or next data unit in an array ofdata units. For instance, a profiler 230 may read an uncompressed dataunit 220 from memory. Block 310 comprises identifying value-carryingfields for the data unit. Generally, a value-carrying field is any fieldfor which data exists in the data unit, where that data represents somevalue other than a value that has been designated as invalid or “null.”Block 320, which is optional depending on the embodiment, comprisesidentifying the length of the value in each value-carrying field. Notethat the length of the value is not necessarily the length of the datain the field, as the data in the field may include extra “padding” thatdoes not affect the value. For instance, the value 101 may be storedwithin the data unit as the value 00000101. Even though the length ofthe data is eight bits, the value itself only needs to be represented bythree of those bits, and thus is considered to have a length of threebits.

Block 330 comprises generating a new profile, or selecting apre-existing profile, that describes the state of each field to becompressed with respect to the information identified in blocks 320 and,optionally, 330. Hence, for instance, the state information for a givenfield may be a bit that indicates that the field carries a value andwill thus be present within the packed data unit, and that the value forthe field is of a length L. As explained above, to reduce the number ofprofiles, the length indicated by the profile for a field may notnecessarily be the same length as identified in block 320, but rathermay be any number greater than or equal to the length identified inblock 320. Any suitable heuristic for selecting a length may beutilized.

Block 340 comprises, based on the determinations in block 320, and inaccordance with the state information in the profile, removing some orall of the non-value carrying fields from the data unit. For instance, adata packer 250 may utilize a profile 240 assigned by a profiler 130 todetermine a set of fields to output for use in block 360.

Block 350 is optional depending on whether block 330 is performed, andmay be performed before or after block 340. Block 350 comprises removingnon-value carrying bits from the remaining data fields, so as to limiteach value to the length specified in the profile that was generated orselected in block 330. For instance, if the profile specifies a lengthof 4 bits, and the field data within the original data unit were00000101, block 350 would comprise stripping the leading zeros from thefield data and leaving the last four bits 0101. The non-value carryingbits may be specified or implicit from field state data, such as frominstructions sets specifying extraction offsets and extraction lengths.

Block 360 comprises concatenating the data for each of the fieldsremaining after block 340, as potentially shortened in performance ofblock 350, together to form a packed data unit. The field data should beconcatenated together in an order indicated by the profile. Block 370comprises storing the packed data unit in an array of packed data units,such as a table of packed data units or a processing queue. The packeddata unit is stored with the profile generated in block 330. Flow thenreturns to block 305 for processing the next available data unit.

FIG. 4 illustrates an example process flow 400 for compressing dataunits using indexed profiles, according to an embodiment. Blocks 405-420correspond to blocks 305-320. Block 425 comprises determining whether asuitable profile already exists for the data unit. For instance, anarray of profiles, such as profile array 345, may already exist. Block425 may comprise comparing each profile to the information determined inblock 410 and optionally block 420 to determine whether there is alreadya profile with the exact same information, and is thus deemed “suitable”for the current data unit.

Or block 425 may comprise first determining if there are anypre-existing profiles that indicate the presence of the exact same setof fields (or a superset thereof) found to carry values in block 410.Then, block 425 may comprise comparing the lengths defined for thevalue-carrying fields specified in each such pre-existing profile to thecorresponding lengths identified in block 420. If, for one or more ofthe pre-existing profiles, the outcomes of those comparisons meets somethreshold criterion or criteria, then the pre-existing profile that willproduce the smallest packed data unit length for the unit may bedetermined as suitable.

For instance, a first criterion may be whether the respective lengths ofeach field, as specified in the profile, are greater than or equal tothe corresponding data unit field lengths identified in block 420. Asecond criterion may be whether the differences between theprofile-specified lengths and the identified lengths are individually orin aggregate no greater than a predefined threshold amount. Or, thesecond criterion may be whether, for each respective field, dividing theprofile-specified length and the identified length by the samepredefined divisor results in a same quotient. For instance, a divisorof 8 may be used to ensure that packed lengths for a given field fall atbyte boundaries.

If a suitable profile is found, flow proceeds to block 434, describedsubsequently. If no suitable profile is found, then flow proceeds toblock 430, which comprises generating a suitable profile as in block330. Flow then proceeds to block 432, which comprises storing theprofile in a profile array. Flow then proceeds to block 434, whichcomprises retrieving the index of the suitable or newly-generatedprofile from the profile array.

Blocks 440-460 proceed as in blocks 340-360. Block 470 is similar toblock 370, except that the packed data unit is stored with the index ofthe suitable profile rather than with the profile directly.

Flows 300 and 400 are but examples of process flows that are suitablefor compressing data units, according to embodiments. Other processflows may also or instead be utilized to compress data units, includingflows with fewer or additional steps, in varying arrangements.

2.6. Example Packed Data Units

FIG. 5 is a block diagram 500 illustrating an example packed data unit580, according to an embodiment. The original data unit 520 comprisedfield data 522 a through 522 h. Field data 522 a, 522 f, and 522 g are,respectively, 00011111, 11101010, and 00000101. The remaining field dataare each 00000000. In the depicted example, the field data 00000000 isconsidered to be empty or null. Thus, as depicted, field data 522 b-522e are considered to be non-value carrying, as well as field data 522 h.Of course, in other embodiments, other values such as 11111111 may bedesignated as empty or null, or any value starting with a 1 may beinvalid, or the corresponding field data may simply be non-existent.

A compression profile 540 generated for data unit 520 comprises fieldstate data 542 a through 542 h, represented as a single bit thatindicates whether data for the corresponding field can be found inpacked data unit 580. Field state data 542 a, 542 f, and 542 g,corresponding to the value carrying field data 522 a, 522 f, and 522 g,are assigned to 1, while the remaining field state data 542 are assignedto 0 to indicate that they are empty and thus not found in the packeddata unit.

The resulting packed data unit 580 comprises a first segment 581 thatcomprises either a profile 540, or an index that references profile 540in an array of profiles. The resulting packed data unit 581 alsocomprises a second segment 582, corresponding to the packed field data,which in this example is simply a concatenation of field data 522 a, 522f, and 522 g, or 000111111110101000000101.

FIG. 6 is a block diagram 600 illustrating an example packed data unit680 having variable length packed fields, according to an embodiment.The original data unit 620 is the same as the original data unit 520.The compression profile 640 likewise includes field state data 642.However, each field state data 642 includes not only the bit depictedwith respect to field state data 542, but also a value length for thecorresponding field data 622. For instance, field data 622 a, which is00011111, is deemed to have a value length of 5, which is in recordedfield state data 642 a. The resulting packed data unit 680 is similar topacked data unit 580, except that the second segment 682 is packed to1111111101010101.

3.0. Data Decompression

FIG. 7 is an illustrative view of various aspects of an examplesubsystem 700 for decompressing packed data units, according to anembodiment. Subsystem 700 is configured to decompress, or “unpack,” dataunits in an array 770 of data units 780, which may be stored in anysuitable memory 760, such as DRAM, SRAM, registers, and so forth. Forinstance, array 770 may be a table of rules or policy data, a queue ofpacket headers, or any other suitable set of data units. In someembodiments, array 770 need not be a physical data structure that existsat any given moment of time. Rather, inputs into subsystem 700 may becontrolled by another component which releases data units 780 seriallyto subsystem 700, and array 770 is essentially a conceptual illustrationof a group of data units 780 dispensed to subsystem 700 over time.

While the section on compression above sets forth example contexts forcreating arrays of packed data units, such as arrays 170 and 270,subsystem 700 is actually agnostic to the manner in which array 770 isgenerated. In fact, the packed data units may be generated at anentirely different system, and transmitted to an apparatus comprisingsubsystem 700.

From the perspective of subsystem 700, then, the operating constraintsare as follows. An array 770 exists of Y data units 780, each of width W(or less). Each data unit 780 in the array 770 can consist of data for Ndistinct fields from a master set of M fields. The total width of thefields stored in a data unit 780 must be equal to or less than W. N isdifferent for each data unit element in the array 770, and there can bedistinct combinations of fields across different elements of the array770. The number of fields stored in each data unit 780, and thecombination of fields from the master set that make up a data unit maybe determined at runtime and in such cases cannot be staticallyallocated. The packed width of fields from the master set can bevariable and determined at runtime.

3.1. Data Unpacker

Subsystem 700 comprises an unpacker component 750. Unpacker 750 may, forexample, be implemented by one or more Field Programmable Gate Arrays(“FPGA”), Application Specific Integrated Circuits (“ASIC”), or otherspecialized circuitry within a computing device. Unpacker 750 isconfigured to receive, as input, selected packed data units 780, or atleast components thereof, from the array 770.

For each packed data unit 780 inputted into the data unpacker 750, thedata unpacker 750 is configured to unpack the data unit by extractingthe values stored in the packed field data of the data unit 780. Thedata unpacker 750 is further configured to output data reflecting thefields of the unpacked data unit corresponding to the number of fieldsin the master set. In some embodiments, on account of the hardwareimplementation, the length of each field when outputted must be of acorresponding fixed size. Each fixed size may, for instance, be definedby a master field specification such as master field specification 110.The data unpacker 750 may thus further be configured to convert theextracted values to the appropriate length.

Data unpacker 750 thus functions to identify the data to output for eachfield based upon a packed data unit 780 and then deliver that data inthe appropriate form to the field data output 722 that is mapped to thefield. To this end, data unpacker 750 may be seen as logically, if notphysically, comprising a field parser 752 and an optional valueconvertor 754.

3.2. Field Parser

From a logical perspective, field parser 752 accepts as inputs both acompression profile and packed field data for a packed data unit 780.For example, the packed field data may be a packed data unit 180 or 280,while the compression profile may be a compression profile 140 or 240.In other embodiments, the compression profile is not exactly the samedata structure as the original compression profile 140 used duringcompression, but rather may be a counterpart data structure thatincludes sufficient information (e.g. instruction sets, field statedata, etc.) to extract the values from any packed data unit that wascompressed using the original compression profile 140.

In some embodiments the compression profile and/or packed field data mayactually be preprocessed before reaching the field parser 752 forvarious purposes such as described elsewhere in this disclosure.Whatever the case, field parser 752 utilizes field state informationdescribed by the compression profile to determine whether data for afield is found in the packed field data. If so, field parser 752utilizes location information indicated by the profile, such as fieldordering data, profile-specific packed field length data, and/or fixedfield length data, to compute the location in the packed field datawhere the corresponding data is found. The field parser 752 then parsesthe appropriate number of bits from that location to arrive at the valuefor the field. In some embodiments, the field parser 752 may beconfigured to parse the bits for a given field from multiple separatelocations.

3.3. Value Convertor

Once field parser 752 has extracted a value for a field, the optionalvalue convertor 754 may pad the value with “filler” data, such as extraleading zeros, so as to render the uncompressed field data a fixedlength suitable for output to an appropriate field data output 722. Ofcourse, use of the optional value convertor 754 may not be needed inembodiments where the values for a field are always of the suitablefixed length.

In an embodiment, value convertor 754 may also be configured to add avalidity bit, a value-carrying indicator, to each field. For instance,if a field is 32 bits in length, value convertor 754 may append orprepend another bit with a value of 1 to indicate that the outputteddata is valid and a value of 0 to indicate that the outputted data isnot valid. Hence, the outputted data for the field will be 33 bitsinstead of 32 bits.

In some embodiments, a value convertor 754 may employ additional stepsto finish “unpacking” the value. For instance, value convertor 754 mayreformat the value to a different format, or translate the value to adifferent domain. As another example, value convertor 754 may indicatethat certain extracted bits are to be shifted relative to other bits,and/or that filler data should be inserted in between certain extractedbits for a field. In an embodiment, a profile may indicate that thevalue extracted for a given field should actually be mapped to specificbits in the middle of the field rather than the upper or lower bits ofthe field. For instance, the value extracted may be 1010, but theprofile may indicate that the value should be offset by two bits—i.e.placed at the third bit of the field rather than the first bit of thefield, so as to yield a value of xx1010xx. The remainder bits of thefield may be set to 0, or to a value specified by the profile.

As another example, where a more sophisticated compression algorithm hasbeen used, value convertor 754 may cause the value to be decompressedusing a corresponding decompression algorithm. As another example,instead of padding a value with “filler” data, the value convertor 754may pad the value with a profile-specified set of bits that would havebeen stripped from any data unit matched to the profile during thecompression process. Depending on the embodiment, value convertor 754may be configured with the assumption that it is always required toperform such additional steps for some or all of the fields, or valueconvertor 754 may be configured to determine whether it is required toperform such additional steps based on information in the compressionprofile, as described in the compression section of this disclosure.

3.4. Profile Selector

FIG. 8 is an illustrative view of various aspects of another examplesubsystem 800 for decompressing packed data units with reusablecompression profiles, according to an embodiment. Subsystem 800 is inmany aspects similar to subsystem 700. For instance, subsystem 800comprises unpacker 850, field data outputs 822, memory 860, and packeddata unit array 870, which are analogous to unpacker 750, field dataoutputs 722, memory 760, and packed data unit array 770, respectively.

Subsystem 800 processes packed data units 880, which are similar topacked data units 780, except that they comprise a compression profileindex rather than a compression profile. Accordingly, subsystem 800further comprises a profile selector 830. Profile selector 830 may, forexample, be implemented by one or more Field Programmable Gate Arrays(“FPGA”), Application Specific Integrated Circuits (“ASIC”), or otherspecialized circuitry within a computing device, or by specializedsoftware components executed by a computing device. While depicted asseparate logical components for illustrative purposes, in someembodiments profile selector 830 and unpacker 850 are a single,integrated component.

Profile selector 830 is configured to receive or otherwise access thecompression profile index stored in the packed data unit that is beingprocessed by unpacker 850. Based on this index, profile selector 830locates an associated profile 840 in a compression profile array 845.Compression profile array 845 may be stored in any suitable memory. Eachcompression profile 840 includes field state data as described in othersections. Compression profile array 245 is one example of a suitablecompression profile array 845.

Based upon the selected profile 840, profile selector 830 is configuredto send field control information 842 to the unpacker 850. The fieldcontrol information 842, reflects the selected compression profile 840,and may take the form of the compression profile 840 itself, extractedfield state data, actual instructions for parsing fields, or any othersuitable form. Based on the field control information 842, the unpacker850 is then configured to unpack the packed data unit, as described inother sections.

3.5. Example Process Flows

FIG. 9 illustrates an example flow 900 for decompressing packed dataunits, according to an embodiment. The various elements of flow 900 maybe performed in a variety of systems, including systems such as systems700 and 800 described above. In an embodiment, each of the processesdescribed in connection with the functional blocks described below maybe implemented using one or more computer programs, other softwareelements, and/or digital logic in any of a general-purpose computer or aspecial-purpose computer, while performing data retrieval,transformation, and storage operations that involve interacting with andtransforming the physical state of memory of the computer.

Block 905 comprises accessing the first or next data unit in an array ofpacked data units. For instance, an unpacker 850 may read a packed dataunit 880 from memory 860. Block 910 comprises identifying a compressionprofile associated with the packed data unit. For instance, thecompression profile may be embedded within the first or last bits of thepacked data unit. Or, the compression profile may be identified using acompression profile index embedded within the packed data unit. Thecompression profile index may be used to lookup the compression profilein an array of compression profiles.

Block 920 comprises, based on the profile, identifying value-carryingfields within the packed data unit. For instance, field state datawithin the profile may indicate, for each field in the master set,whether data for the field is found in the packed data unit. Block 930comprises, for each value-carrying field in the packed data unit,parsing a value from the packed data unit. The parsing may be based onlocation information indicated by the compression profile, as well asprofile-specified length information or fixed length information, asdescribed in other sections.

Block 950, which is optional depending on the embodiment, comprisespadding each field's value to a fixed length expected for that field.For instance, the fixed length may be defined by a master fieldspecification, or defined to be a number of bits that are expected forthe field by a destination component to which the value will be output.The padding may comprise adding leading zeros to the value untilappropriate length is reached, adding some other set of filler bits thatwill not be interpreted as changing the underlying value of the field,or adding some profile-specified set of bits. In some embodiments, thepadding may be performed at locations other than the leading bits, suchas in between extracted bits or at the end of a field, depending oninstructions from the profile.

Block 960 comprises, for at least each value-carrying field, outputtingthe corresponding identified value, as parsed and optionally padded orotherwise manipulated in the previous blocks. For instance, each field'svalue may be sent to an output mapped to that field, such as fieldoutputs 822. In an embodiment, null values may be sent to field outputs822 for non-value carrying fields. In another embodiment, a validity bitis included in the data sent to each field output 822 (thus extendingthe size of the field data that is output) indicating whether the fieldis value-carrying or not. In yet another embodiment, no data is outputfor non-value carrying fields.

Flow then returns to block 905 for processing the next data unit.

FIG. 10 illustrates another example flow 1000 for decompressing packeddata units, according to an embodiment. Flow 1000 may be considered aspecific example of how flow 900 may be implemented.

Block 1005 and 1010 proceed as with blocks 905 and 910. Once the dataunit and the corresponding profile have been identified, flow 1000proceeds to iterate through each field in a master set of fields. Blocks1015 comprises identifying the first or next unprocessed field in themaster set of fields. In some embodiments, the fields are processed in aspecific order corresponding to the order in which they are sequenced bythe profile.

Block 1020 comprises determining whether the profile indicates that thepacked data unit carries a value for the current field. The profile mayindicate this information in a variety of manners described elsewhere inthe disclosure. If the packed data unit carries a value for the field,then flow proceeds to block 1030. Otherwise, flow proceeds to block1065, which comprises optionally outputting a null value or any othervalue considered to be invalid.

Block 1030 comprises identifying the packed length of the value for thefield within the packed data unit based on data in the profile or in themaster field specification. Block 1040 then comprises extracting a setof bits from the field equal in number to the packed length of thefield, as identified in block 1030. Depending on the embodiment, thebits may be extracted from the front of the packed data unit or the endof the packed data unit. In yet another embodiment, the bits may beextracted from any location within the packed data unit.

Block 1050 comprises optionally padding the extracted bits to reach thefixed length defined for the field, in similar manner to block 950.Block 1060 comprises outputting the field data for the field to thecorresponding mapped field output, in similar manner to block 960. Block1065, which is optional and performed only if the packed data unit doesnot include a value for the field, comprises outputting a null value forthe field.

Block 1070 comprises determining whether there are additional fields inthe master set to process. If so, flow returns to block 1015 forprocessing the next field. Otherwise, flow proceeds to block 1005 forprocessing the next packed data unit.

Flows 900 and 1000 are but examples of process flows that are suitablefor decompressing data units, according to embodiments. Other processflows may also or instead be utilized to decompress data units,including flows with fewer or additional steps, in varying arrangements.

4.0. Implementation Examples and Optimizations

4.1. Example Use Cases

According to an embodiment, the subsystems described herein may beadvantageously deployed in hardware within network infrastructuredevices, such as routers or switches, to allow those networkinfrastructure devices to store larger sets of certain types of dataunits within relatively faster but more expensive memories. The hardwareimplementation greatly reduces the overhead associated withdecompressing the data units, allowing the network infrastructure tocontinue to route data packets and/or apply policies to those data unitswith acceptable speeds. Meanwhile, the increased capacity for storinglarger data sets allows the network infrastructure devices to implementmore complex rules, policies, and filters. The increased capacity mayalso or instead increase the amount of data that may be buffered and/orcached at the network infrastructure devices, thus increasing theeffective throughput of the network infrastructure devices.

For instance, in an embodiment, packets processed by a networkinfrastructure device are associated with a Virtual Network Identifier(VNI). For each VNI, an entry in a VNI Table stores policies andattributes to be applied to packets belonging to that VNI. There can bea large set of policies and attributes across all VNIs, such as dropactions, forwarding policies, learn policies, counter indexes, controls,and so forth. However, for each VNI only a subset of the policies andattributes apply. Accordingly, the VNI table may be stored in acompressed form using the techniques described herein. One or moreFPGAs, ASICs, or other specialized circuitry within the networkinfrastructure device may thus be configured to implement the describedcompression subsystem and/or decompression subsystem for compressingand/or decompressing VNI entries. Accordingly, the VNI table may belarger and/or stored in a faster memory than it might otherwise havebeen.

As another non-limiting example, each data unit in the array may bePacket Encapsulation Headers and instructions for how to edit packetsforwarded towards a nextHop router. There is a large set of packet editinstructions and type of packet encapsulation headers across all thenextHops. However for each nextHop, there is only a subset of PacketEncapsulation Header types and edit instructions. Accordingly, thenetwork infrastructure device may benefit from inclusion ofhardware-based subsystems configured to compress and/or decompress thePacket Encapsulation Headers and instructions.

In other embodiments, other types of computer apparatuses may alsobenefit from implementation of the subsystems and techniques describedherein. Moreover, in other embodiments, certain network devices andcomputing apparatuses may still derive at least some benefits fromsoftware-based implementations of the described techniques.

4.2. Advanced Compression Schemes

According to an embodiment, the field state data may specify multiplesubportions of a field's data that should be included in a packed dataunit, in contrast to other subportions of the field data that should beignored. For example, the field data for a certain field in a certaintype of data unit may always comprise two or more discrete subportionsin which significant bits may be found, separated by portions that arealways insignificant (e.g. always equal to zero or always equal to thesame value). The field state data for such a field may include multiplepairs of extraction offsets and extraction lengths, each indicating adifferent subportion of the field to extract. For instance, for acertain profile, the field data for a certain field may always conformto the format 00xxx000xx, where x stands for a significant bit (i.e. a 0or 1, depending on the value represented). The field state data mayspecify that a subportion of three bits in length, starting at the thirdbit of the field data, should be extracted and placed in the packed dataunit, followed by a second subportion of two bits in length, starting atthe second to last bit of field data, thus yielding the packed data ofxxxxx. Or the field state data may specify that two bits should beignored, followed by three bits extracted, followed by three bitsignored, and followed by two bits extracted. Of course, any othersuitable instructions may be used. Any number of significant subportionsmay be extracted for a given field in this manner. The data unpacker mayutilize such field state data in reverse, to reinsert thenon-value-carrying bits (e.g. by shifting the subportions relative toeach other or performing other suitable operations).

In many examples in this disclosure, for illustrative purposes, the bitsto be discarded (i.e. the insignificant or non-value-carrying bits) aredepicted as being set to 0. However, insignificant or non-value-carryingbits may be discarded regardless of whether the bits are set to 0 or 1.In some embodiments, these bits may be discarded because it truly doesnot matter what the values of those bits are. Being able to rely uponthe insignificant bits as being set to 0 does make possible embodimentswhere the non-value-carrying bits of a data unit may be identified basedon an analysis of the data unit itself. However, since in otherembodiments metadata describing a data unit may be used to determinewhen a subset of bits is value-carrying, it is not necessary that thenon-value-carrying bits actually be set to 0.

In some embodiments, however, a profile may indicate to ignore certainbits when creating a packed data unit not because the bits arenon-value-carrying, but instead because the bits will always be the samefor any data unit that is matched to the profile. In such an embodiment,the profile may include instructions that indicate where such bits arelocated, and what the values of these bits should be. For instance, fora given profile, the field data for a certain field may always have theformat 1010xxxx. The profile may indicate that the bits xxxx are to beincluded in the packed data unit, and that the bits 1010 should proceedbits xxxx when the data unit is decompressed. In other words, theprofile may indicate that the data packer should pad the field with thebits 1010 instead of 0000.

In yet other embodiments, any compression scheme describable by aprofile may be utilized.

4.3. Data Packer Example

According to an embodiment, a data packer component is configured toutilize a given profile to compress a vector of size V bits to a packeddata unit. The vector and profile are inputted to the data packer. Theprofile includes a plurality of instruction sets, each corresponding toa different field. Each instruction set specifies, implies, or otherwiseindicates, for its field, at least a field start offset in the vector atwhich the data for the field is located, an extraction length equalingthe number of bits to extract for that field, and a target offset withinthe packed data unit at which the extracted bits are to be placed. Thedata packer determines a length N for packed data unit by adding up theextraction lengths for all fields described by the profile. The datapacker initializes a packed data unit of size N bits to a value of allzeros.

The data packer iterates through each instruction set in the profile.Each iteration involves a shift operation on the vector. The shiftoperation may be performed on a new copy of the vector for eachiteration, or the previously shifted vector may be utilized, in whichcase a current vector offset is utilized to track how far the vector hasalready been shifted. For example, for each instruction set, based onthe field start offset and, optionally, the current vector offset, thedata packer may determine a shift direction and a shift amount to shiftthe vector in order to place the bits to be extracted at the targetoffset within the lower N bits of the vector. Valid shift directions areleft and right. Valid shift amounts are from 0 to V−1. The data packerthen shifts the vector in the shift direction by the determined shiftamount.

For each instruction set, the data packer also performs a mask operationto mask out any bits that do not carry the value to be extracted for thefield corresponding to the currently iterated instruction set. The datapacker may, for example, determine a mask length L and mask start offsetfor use with the instruction set. Valid values for both are from 0 toN−1. A mask of N bits is generated, in which L consecutive bits areassigned to 1, starting at the mask start offset, but all other bits areset to zero. The mask length and mask start offset are determined fromthe profile's target offset and the extraction length such that the iscover the extracted bits. That is, the mask length is the extractionlength. The data packer then performs an AND operation between the maskand the lower N bits of the shifted vector.

The data packer then performs bitwise operation(s) to load the extractedvalue into the packed data unit. For instance, the data packer mayperform an OR operation between the previously initialized packed dataunit, as modified from any previous iterations, and the N bits that wereoutput from the AND operation. The result of the OR operation is kept inthe packed data unit, and the data packer repeats the above processesfor each instruction set. After all instruction sets are processed, theresulting packed data unit is then stored or passed on to anotherprocessing component, depending on where the data packer is deployed.

The above embodiment is but one example of how a data packer may beimplemented. A variety of other embodiments exists. For instance,different combinations of masks and bitwise operations may produceequivalent results. As another example, the logic may be configured suchthat the value-carrying bits are shifted into upper N bits of theunpacked data unit instead of the lower N bits.

More generally, the data packer may be configured to, for eachvalue-carrying field, loading value-carrying bits from the unpacked dataunit into a target offset within the packed field data by performing oneor more shift operations on the unpacked data unit, one or more maskoperations on the unpacked data unit, and one or more merge operations(e.g. bitwise operations) to merge the packed field data and a result ofthe one or more shift operations and the one or more mask operations,the result of the one or more merge operations replacing the packedfield data.

4.4. Modular Data Packer

In the above-described iterative implementation, if there are Xinstruction sets, then the data packer must perform X sequentialiterations for each instruction set. The amount of time the data packerrequires to pack a single data unit obviously increases with the size ofX. For larger vectors, such as vectors on the order of a few kilobits,the delay introduced by such a data packer may be undesirable.

As an alternative, the data packer may be implemented using modules thatact in parallel upon X separate copies of the data unit. Each moduleexecutes the shift and mask logic with respect to a differentinstruction set on a separate copy of the data unit. Each module thusarrives at a result of size N bits (N being the expected size of thepacked data unit) that encodes the data for a single field (if the fieldis value-carrying) at the profile-specified target offset, but isotherwise set to zero. The data packer then performs a bitwise ORbetween the X results to arrive at the packed data unit. Such a datapacker obviously reduces the total amount of time to pack a data unit,but may also greatly increase the resources necessary to implement thedata packer.

Yet another alternative would be for the data packer to include Kmodules capable of executing the shifting and masking logic in parallelon their own copies of the data unit. The X instruction sets are dividedamongst the K modules, each requiring no more than X/K iterations toproduce a result. The data packer may then perform a bitwise ORoperation on the results from the modules.

Container-Based Packing

Conceptually, a profile may indicate both instructions for packing adata unit and instructions for unpacking individual fields from the dataunit. In many of the examples given herein, these instructions aresynonymous—in other words, instructions for unpacking individual fieldsare simply the “reverse” of the instructions for packing a data unit. Insome embodiments, however, this is not necessarily the case. Forinstance, in at least one embodiments, a concept of containers is usedfor packing a data unit, and the profile thus contains container-basedcompression instructions. In an embodiment, a data packer that utilizescontainer-based packing may be improved using modular packing logic. Thecontainer-based data packing scheme is thus described with respect to amodular data packer, though it may also be used without a modular datapacker.

The container-based data packing scheme involves dividing a vector intoa number of containers indicated by the container-divisioninstruction(s) in the profile. A given container may include a singlefield, multiple fields, or portions thereof. Some containers may spanonly a subportion of a field. The container-division instruction(s) maysimply specify a number of containers to create, or a desired containersize, and the boundaries of each container may thus be calculated basedthereon. Or, the container-division instructions may actually specify asize for each container, or a boundary for each container.

According to an embodiment, the container-division instructions may havebeen created based on information known about the vectors that match theprofile. For instance, container sizes may be selected such thatportions of the vector known to at least potentially compress welltogether are placed in a single container. Thus, for instance, a firstcontainer may be of a default size of 128 bits. A second container maybe of size 32 bits if the next 32 bits are known to correspond to one ormore densely-populated fields. A third container may be of 256 bits ifthe next 256 bits are known always be 0 except for only onevalue-carrying field. The remaining containers may be of the defaultsize, or further customized in similar manner.

Once divided into containers, the vector is compressed on acontainer-by-container basis rather than on a field-by-field basis(though, of course, in some cases the boundaries of a container may bethe same as those of a field). The container-based compressioninstructions include, in addition to the container-divisioninstructions, container-relative extraction location information thatindicates what data to extract from the container for inclusion in thepacked data unit. A container is then compressed in similar manner to afield, using extraction location information as described elsewhere inthis disclosure, though with respect to the container rather than afield. Any suitable compression technique may be used with respect tothe container, including specifying multiple extraction locations,removing bits that will always be set to the same value, and so forth.In an embodiment, a data packer includes multiple modules, eachconfigured to compress a different set of one or more of thesecontainers in parallel.

As an example of the container-based approach, a vector may be dividedinto R segments of T bits. For instance, a 4096-bit vector can bedivided into sixty-four 64-bit segments where segment 0 consist of bits0-63, segment 1 consist of bits 64-127, and so forth. The modular datapacker includes C containers of size T bits, where C is some numbergreater than the number of fields from a master set that will be storedin the packed data unit. A modular data packer profile stores the size Nof the packed data unit N, or this can be inferred by a particularinstantiation of the modular data packer. The modular data packerprofile further stores, for each container C: a container segment offsetrelative to the entire vector, indicating which segment R to write intothe container; a container shift amount ranging in size from 0 to N−1, acontainer mask start offset ranging in size from 0 to T−1, and acontainer mask length L ranging in size from 0 to T−1. This informationmay be separate from the field extraction length and target offsetinformation that will be used to decompress the packed data unit, sincethe containers may not necessarily have a one-to-one mapping to thefields.

The modular data packer initializes the packed data unit to N bits of 0.The modular data packer comprises C modules that are assigned to the Ccontainers. In parallel, these modules process their respectivecontainers as follow. A module generates a container mask of size Tbits, in which L consecutive bits are assigned to 1, starting at thecontainer mask start offset, but all other bits are set to zero. Theconsecutive bits can be in increasing offsets or decreasing offsets. Themodule performs an AND operation between the container mask and theoriginal container to generate a masked container.

Each masked container is then processed in parallel. If T is less thanN, then each container is padded with N−T bits of leading zeros to forma value of size N bits. If T is greater than N, then no padding isnecessary. The module processes the masked container then left shiftsthe result by the container shift amount. Finally, the data packerperforms a bitwise OR to merge all of the shifted containers together.The result is the final compressed data unit.

Of course, other implementations are possible. For instance, extendingthe masked container by trailing zeros and performing a right shiftwould also be a valid implementation.

In an embodiment, as indicated above, the profile may specify variablesize containers. For instance, some containers may be of size T bits,while others may be of size T/4 bits, yet others may be of size 2T bits,and so forth. The implementation may also be extended into multiplestages. For instance, during a first stage a first-processing datapacker may condense 4K bits to 512 bits, and during a second stage asecond-processing data packer may condense the 512 bits to 50 bits. Thefirst stage may, for instance, involve large container sizes, shifted bylow granularity amounts such as multiples of 4 or 8 bits. The secondstage may, for instance, involve smaller container sizes and shiftamounts of lower granularity, such as single bits.

The unpacking instructions (e.g. field state data, instruction sets,etc.) used for unpacking field data from the data unit once compressedwill typically be different than the container-based compressioninstructions, and thus stored separately within the profile. Or, theremay be two profiles associated with data unit—a compression profile withcontainer-based compression instructions for compressing the data unit,and a decompression profile with field-based unpacking instructions forunpacking the field data from the packed data unit. In any event, thoughthe unpacking instructions must be created based on knowledge of howwhere the field data for each field will be stored relative tocompressed containers, the data unpacker may be agnostic to whether thecontainers were used to pack the data unit, as the containers need notbe reconstructed during the unpacking process.

In some cases, particularly those where the profile divides the vectorinto containers using a relatively simple scheme (e.g. equally-sizedcontainers), compression of the vector on a container-by-container basismay not necessarily produce a packed data unit that is compressed asoptimally as one compressed on a field-by-field basis. However, becausethe cost of dividing up the vector into such containers may be less thanthat of dividing the vector into fields, the container-based approachmay produce close to optimal results more efficiently than thefield-by-field approach. On the other hand, in some cases, certainfields that would be difficult to compress by themselves may be dividedinto multiple containers that are much more easily compressed. Thus, insuch cases, the container-based division of the vector may actuallydeliver better compression results than a field-based division. However,such cases may often require more complex logic to divide the vectorinto containers that will achieve the desired result, thus increasingthe expense of the compression process.

4.5. Example Data Unpacker

Although the field parser and value convertor subcomponents of the dataunpacker are described herein in various instances as being separatecomponents, the field parser and value convertor may in fact be a samecomponent, configured to extract the relevant bits for a field andconvert the value to conform to an expected output format in the sameoperation(s). For example, in embodiments where the only conversionneeded is to pad a value with extra zeros, the extraction and padding ofzeros may be accomplished through the use of masks and bitwiseoperations, in much the same manner that the data packer compressed thedata in the first place.

For instance, in one implementation, the data unpacker may iteratethrough each field described in the profile. For each field, the dataunpacker may perform a shift operation on the packed data unit thatshifts the packed data unit a number of bits equal to the target offsetwithin the packed data unit where the packed data for a field is found,or the difference between the target offset and any amount the packeddata unit has already been shifted, if the packed data unit is reused ineach iteration. This operation places the packed data for the field inthe lowest bits of the shifted packed data unit. A mask may be generatedin which a consecutive number of bits equal to the size of the packeddata for the field are set to 1, beginning with the lowest bit. Thisleaves a leading number of bits in the mask set to 0. The mask should bethe size of the expected field output. The data unpacker performs an ANDoperation between the shifted packed data unit and the mask. The resultof the operation is, in essence, the extracted value already padded withleading zeros. The result may then be sent to the corresponding fieldoutput, optionally with the addition of a validity bit, depending on theembodiment.

Of course, a variety of other implementations are possible, includingimplementations that make use of different masks, combinations ofbitwise operations, and so forth. Hence, more generally, the dataunpacker may be configured to extract value-carrying bits for a field byperforming one or more shift operations and one or more mask operationsindicated by target offset and extraction length information in thecompression profile.

4.6. Partially-Packed Data Units

According to an embodiment, in spite of the optimizations describedherein, the unpacking of a data unit nonetheless introduces unavoidablelatency to the processing of that data unit. This latency may beacceptable for certain types of data units, or at least for certain lesssignificant fields of a data unit. On the other hand, the latency may bemitigated by only partially packing the data unit, such that higherpriority fields are stored fully and uncompressed. Processing of thehigher priority fields may thus begin immediately, while the lowerpriority fields are still being unpacked. Ideally, the unpacked dataunits may not be needed for processing until after they have alreadybeen unpacked. However, even if the packed fields have not been unpackedbefore the system is ready for them, this technique will still reducethe overall processing time for the data unit.

FIG. 11 is an illustrative view of various aspects of an examplesubsystem 1100 for decompressing partially-packed data units, accordingto an embodiment. System 1100 comprises many components similar to thosein system 800. For instance, system 1100 comprises a memory 1160, packeddata unit array 1170, profile selector 1130, field control information1142, unpacker 1150, and field data outputs 1122, which are analogous,respectively, to memory 860, packed data unit array 870, profileselector 830, field control information 842, unpacker 850, and fielddata outputs 822.

However, the data units 1180 within array 1170 are only partiallypacked. That is, in addition to including a compression index and packedfield data, data units also includes one or more subunits of fixed fielddata that has not been packed. The one or more subunits of fixed fielddata correspond to one or more high priority fields that need not beprocessed by the unpacking logic of unpacker 1150. The fixed fields arethe same for each data unit in the array. The fixed field data isneither omitted when not carrying a value, nor condensed or otherwiseprocessed during the compression stage, except if needed to ensure thatthe fixed field data is ready for use by the components to which thefixed field data will be directed. The compression profiles may or maynot indicate the presence of fixed fields, depending on the embodiment.

Subsystem 1100 comprises a fixed field filter 1155. As with othercomponents of subsystem 1100, fixed field filter 1155 may be implementedby one or more Field Programmable Gate Arrays (“FPGA”), ApplicationSpecific Integrated Circuits (“ASIC”), or other specialized circuitrywithin a computing device. Moreover, though depicted as logicallyseparate components, fixed field filter 1155 may be integrated with oneor both of unpacker 1150 and profile selector 1130.

In an embodiment, a data unit passes through fixed field filter 1155before delivery to unpacker 1150. The fixed field data is stripped fromthe data unit and directed to one or more fixed field data outputs.These outputs are coupled to other processing components, which beginprocessing the fixed field data in parallel with unpacker 1150 unpackingthe packed field data in the remainder of the data unit.

As depicted, the fixed field data is found in the least significant bitsof each partially packed data unit, for ease of extraction. That is, thedata unit has been partitioned such that the lower L bits are fixed,while the upper U bits are governed by the unpacker. However, in otherembodiments, the fixed field data may be stored in other locationswithin the partially packed data unit.

The selection of which field(s) should be packed rather than fixed willbe highly dependent on the nature of the packed data units and theoverall system in general. The selection will typically involveindividual experimentation for the specific type of data unit beingprocessed. For instance, for a certain type of data unit that always hasvalues for certain types of fields, such as the IP source address ordestination address in a packet header, it may make sense to not packthese fields, since the IP source address and destination address mayboth be needed relatively early in the processing of the data unit, andwould in any event not likely save much room if packed. Othernon-limiting examples of field types that may be useful to store asfixed fields may include protocol indicators, version indicators, typeindicators, and so forth, upon which processing logic may branchrelatively early in the processing of the data unit. On the other hand,expected reductions in latency must be carefully balanced againstincreased data unit sizes in storage.

FIG. 12 is a block diagram 1200 illustrating an example partially packeddata unit 1280, according to an embodiment. The original data unit 1220is the same as the original data units 520 and 620. The compressionprofile 1240, however, omits field state data 1242 for fields 1222 g and1222 h, which have been designated as fixed fields. Moreover, in thepacked data unit 1280, both of these fields are stored in complete form,even though field 1222 g could be compressed in length, and field 1222 hwould have been omitted entirely in a fully packed data unit.

4.7. Pipelined Unpacker

The latency to unpack a data unit grows with the length of the packeddata unit and the number of fields that are possible in the master set.One enhancement to minimize the increase in latency for larger dataunits or master field sets is to implement a “pipelined” unpacker. Theunpacker unpacks fields in multiple stages. A first stage unpacksrelatively critical fields from a timing perspective. For instance, thefirst stage may unpack a set of N fields found at the least (or most,depending on the embodiment) significant bits of the data unit.Additional stage(s) may iteratively process additional fields that areless critical from a timing perspective.

4.8. Nested Unpackers

According to an embodiment, a data unit may be unpacked using nestedcompression profiles and unpackers. A compression profile index isstored with the data unit. However, the referenced profile may onlyunpack a variable segment of the data unit. The profile may thenindicate that one of the fields that was unpacked is a nested profileindex, which is used to unpack the rest of data unit. Any level ofnesting may be implemented.

4.9. Parallel Unpackers

According to an embodiment, a large data unit may be divided amongstmultiple data buses, each routing a different segment of the data unitto a different unpacker configured to unpack a different set of fields.The unpackers may work in parallel and output different sets of unpackedfields.

In an embodiment, a “two-directional” pair of unpackers may be utilizedin parallel, one operating in reverse of the other. The compressionprofile indicates, either directly or indirectly, unpacking instructionsrelative to both the upper bits of a packed data unit and the lower bitsof the packed data unit. For instance, a compression profile mayindicate a target offset for a field relative to both the upper bits andthe lower bits of the packed field data. A first unpacker startsunpacking from the highest bits using the instructions relative to theupper bits, while a second unpacker starts unpacking from the lowestbits using the instructions relative to the lower bits. The unpackersmay be configured to continue until they meet somewhere near the middleof the packed data unit. Or, the packed data unit may be divided upfront, and the unpackers are configured to only unpack their assignedportions of the packed data unit. Such an embodiment may also becombined with fixed fields. For instance, the middle of the data unitmay be passed as a fixed field, while two-directional unpackers areconfigured to stop when the fixed field is reached, or skip over thefixed field.

4.10. Multiple Data Unpackers

In an embodiment, a computing apparatus may comprise multiple differentdata unpackers, each configured to unpack different arrays correspondingto different types of data units having different master sets of fields.Data unpackers may be implemented generically, such that they may beapplied to any master set of fields of no more than a certain size, andthen programmed for a specific type of data (i.e. a specific master set)at runtime. Or, the data unpackers may be hard-coded to function withpredefined master sets. In any case, in embodiments, the profilesutilized by a specific unpacker may be bound at runtime and/or modifiedduring runtime.

4.11. Genericized Data Units

According to an embodiment, the types of data units processed by thesystems described herein may be expanded by implementing one or moreintermediate levels of interpretation between unpacking the field dataand utilizing the values stored therein. For instance, a singlegenericized data unit may be used to represent two or more differenttypes of data units. The generic data unit may include a field thatindicates what type of data is represented by the generic data unit. Amapping associated with the indicated data type indicates one or morefields of the generic data unit that should be reinterpreted as specificfields of the indicated data type. The generic data unit fields may beinterpreted by one or more hardware layers to which the unpacker outputsthe fields, and/or software configured to process the outputs of theunpacker.

For example, a device may utilize the same decompression subsystem tounpack two different arrays of two different data types. From theunpacker's perspective, data units of both types may be treated in theexact same manner. For instance, the data units may be considered asgenerically holding a “Field A” or “Field B.” The unpacker may outputthe values (if any) of Field A or Field B to one or more interpretationsubsystems. An interpretation subsystem is configured to utilize thevalue of Field A to identify how to handle Field B (i.e. the valueindicates the appropriate data unit type). For example, if Field Aindicates that the data unit is an IP packet header, Field B might beinterpreted as a protocol field, whereas if Field A indicates that thedata unit is a rule, Field B might be interpreted as a policy attribute.Based on the value of Field A, the interpretive subsystem may, forinstance, determine which of multiple possible subsystems should beresponsible for receiving and processing Field B, thus affecting howField B is interpreted. Of course, Field A may similarly control theinterpretation of many more generic fields.

On the other hand, not all fields in the genericized data unitnecessarily need to be reinterpreted. For instance, each of thedifferent types of data units may still include a common subset offields, such as a source address and/or destination address, that areprocessed in the same manner regardless of the interpreted data unittype. In any event, for data units that comprise fields of differentfixed lengths, and/or for optimization purposes, various pre-processingsteps may need to be performed prior to compression, such as adding orremoving padding to certain fields, reorganizing certain fields, addingempty fields, and so forth, so as to conform the different types of dataunits to a common generic data structure. Likewise, variouscorresponding post-processing steps may need to be performed afterunpacking the genericized data unit to reverse the transformation.

5.0. Example Embodiments

Examples of some embodiments are provided, without limitation, in thefollowing paragraphs.

According to some embodiments, an apparatus comprises: a profilerconfigured to associate compression profiles with unpacked data units,each of the unpacked data units having allocated space for storing fielddata for each field in a master set of fields, but only carrying valuesfor a subset of fields in the master set, each of the compressionprofiles indicating a specific combination of value-carrying fields inthe master set of fields, and specifying packed value lengths for theindicated value-carrying fields; and a data packer component configuredto generate packed field data for a given unpacked data unit based on agiven compression profile, of the compression profiles, that theprofiler associated with the given unpacked data unit, the packed fielddata including values for the specific combination of value-carryingfields indicated by the given compression profile, the values condensedwithin the packed field data to corresponding packed value lengthsspecified by the given compression profile, the data packer componentfurther configured to store or transmit the packed field data inassociation with information identifying the compression profile.

In at least some of the above embodiments, the apparatus furthercomprises: a memory storing an array of the compression profiles,wherein the profiler is configured to pass an index to the givencompression profile associated with the given data unit to the datapacker component, and the data packer component is configured to storeor transmit the index in association with the packed field data for thegiven unpacked data unit.

In at least some of the above embodiments, the profiler is configured toassociate the given unpacked data unit with the given compressionprofile by matching descriptive metadata associated with the given dataunit to the given compression profile.

In at least some of the above embodiments, the profiler is configured togenerate a new compression profile to associate with a particular dataunit when none of the compressions profiles is determined to be suitablefor a particular unpacked data unit.

In at least some of the above embodiments, each particular profile ofthe compression profiles comprises, for each field of at least thespecific combination of value-carrying fields indicated by theparticular profile, data indicating a field extraction start offset fromwhich to extract bits for the field in particular unpacked data unitsthat are associated with the particular profile, a field extractionlength corresponding to a number of bits to extract from the particularunpacked data units, and a target offset corresponding to a locationwithin particular packed data units at which the extracted bits are tobe stored.

In at least some of the above embodiments, the target offset isindicated by inference from a running sum of each field extractionlength.

In at least some of the above embodiments, each particular profile ofthe compression profiles comprises instructions for dividing theunpacked data unit into containers, the data packer component comprisingmodules that separately process each of the containers, the modules areconfigured to shift and mask data within their respective containers,the data packer component configured to generate the packed field databy merging results from the modules.

In at least some of the above embodiments, for a particular unpackeddata unit there are a greater number of containers than value-carryingfields, but a lesser number of containers than fields in the master set.

In at least some of the above embodiments, the apparatus furthercomprises: a memory storing a packed data array, the packed data arraycomprising an entry for each data unit of the data units, the entryincluding specific packed field data for the data unit and either acompression profile corresponding to the compression profile informationor an index that references the compression profile, wherein the datapacker component is coupled to the memory.

In at least some of the above embodiments, the data packer component isfurther configured to generate the packed field data by, for each givenfield of the value-carrying fields in the given unpacked data unit,based on field offset and field length information indicated by thegiven compression profile, loading value-carrying bits from the givenunpacked data unit into a given target offset within the packed fielddata by performing one or more shift operations on the given unpackeddata unit, one or more mask operations on the given unpacked data unit,and one or more bitwise operations to merge the packed field data with aresult of the one or more shift operations and the one or more maskoperations, the result of the one or more bitwise operations replacingthe packed field data.

In at least some of the above embodiments, the data packer componentcomprises modules that perform said loading in parallel for at least twoof the value-carrying fields.

In at least some of the above embodiments, at least a first unpackeddata unit of the unpacked data units processed by the data packercomponent has values for a different combination of fields than a secondunpacked data unit of the unpacked data units, the profiler configuredto associate the first unpacked data unit with a first compressionprofile of the compression profiles that specifies a first combinationof value-carrying fields, the profiler configured to associate thesecond unpacked data unit with a second compression profile of thecompression profiles that specifies a second and different combinationof value-carrying fields.

In at least some of the above embodiments, at least a first unpackeddata unit of the unpacked data units processed by the data packercomponent has values for a same combination of fields as a secondunpacked data unit of the unpacked data units, the profiler configuredto associate the first unpacked data unit with a first compressionprofile of the compression profiles that specifies first packed valuelengths for the combination of fields, the profiler configured toassociate the second unpacked data unit with a second compressionprofile of the compression profiles that specifies second and differentpacked value lengths for the combination of fields.

In at least some of the above embodiments, the given compression profilespecifies packed lengths for a particular one or more fields, theparticular one or more fields including at least two fields for whichthe given compression profile specifies different packed lengths, thedata packer component configured to extract different amounts of bitsfor each of the at least two fields based on the specified packedlengths.

In at least some of the above embodiments, the given compression profilecomprises an entry for each field in the master set of fields, the entryindicating at least whether the corresponding data unit has a value forthe corresponding field, and the packed length of that value within thepacked field data for the field.

In at least some of the above embodiments, the apparatus is a networkingapparatus and the data unpacker component is implemented by a FieldProgrammable Gate Array or Application Specific Integrated Circuitwithin the networking apparatus.

In at least some of the above embodiments, the apparatus furthercomprises multiple data packer components configured to compress anunpacked data unit in sequential stages, the packed field data output byone of the stages being passed as an unpacked data unit to a next stageof the stages.

In at least some of the above embodiments, the data packer component isconfigured to include first values from a fixed set of fields in thegiven data unit without condensing the first values.

In at least some of the above embodiments, the given compression profileindicates a given packed data length for a given field by inference froma sum of multiple extraction lengths specified by the given compressionprofile for the given field, each of the multiple extraction lengthscorresponding to a different extraction location within the field dataof the given field, the data packing component configured to extract anumber of bits equal to the extraction length from the correspondingextraction location to store as part of a given value for the givenfield within the packed field data.

According to some embodiments, a method comprises: for each vector of aplurality of vectors, each vector having bits allocated for each fieldin a master set of fields: identifying value-carrying fields for whichthe vector comprises valid values; identifying lengths of thevalue-carrying fields; based on the identified value-carrying fields andlengths, associating a compression profile with the vector, thecompression profile indicating, for each of the value-carrying fields,at least an extraction offset and an extraction length; generating apacked data unit by, for each field of the value-carrying fields,extracting a number of bits equal to the extraction length for the fieldfrom the extraction offset for the field within the vector, and loadingthe extracted number of bits into a corresponding target location withinthe packed data unit; storing or transmitting the packed data unit inassociation with information identifying the compression profile.

In at least some of the above embodiments, the compression profileindicates the extraction offset for each field by specifying a fieldstart offset for the field and a field extraction offset relative to thefield start offset of that field.

In at least some of the above embodiments, the compression profileindicates a target offset that indicates the target location.

In at least some of the above embodiments, identifying thevalue-carrying fields and the lengths of the value-carrying fieldscomprises receiving descriptive metadata associated with the vector,wherein associating the compression profile with the vector comprisesmatching the descriptive metadata to the compression profile in an arrayof pre-defined compression profiles.

In at least some of the above embodiments, the method further comprisesassociating different vectors of the plurality of vectors with differentcompression profiles, the different compression profiles specifyingdifferent extraction lengths for the same field.

In at least some of the above embodiments, the method further comprisesassociating different vectors of the plurality of vectors with differentcompression profiles, the different compression profiles specifyingthat, for a first subset of the plurality of vectors that is associatedwith a first profile of the different compression profiles, a first setof fields are value-carrying, and that for a second subset of theplurality of vectors that is associated with a second profile of thedifferent compression profiles, a second and different set of fields arevalue-carrying.

In at least some of the above embodiments, loading the extracted numberof bits into a corresponding target location within the packed data unitcomprises performing one or more shift operations on the vector, one ormore mask operations on the vector, and one or more bitwise operationsto merge the packed data unit with a result of the one or more shiftoperations and the one or more mask operations.

In at least some of the above embodiments, the method further comprisesperforming said loading in parallel for at least two of thevalue-carrying fields.

In at least some of the above embodiments, the compression profileindicates, for a given field of the value-carrying fields, multiplepairs of extraction offsets and associated extraction lengths, themethod comprising extracting a corresponding number of bits from each ofthe multiple extraction offsets.

According to some embodiments, a method comprises: for each particularvector of a plurality of vectors, each particular vector having bitsallocated for each field in a master set of fields: based on descriptivemetadata associated with the vector that at least indicates which fieldsin the master set are valid for the vector, associating a compressionprofile with the vector, the compression profile specifying, for eachcontainer of a plurality of containers, a container offset correspondingto the location of the container in the vector, a container shiftamount, a container mask start offset, and a container mask length;dividing the vector into the plurality of containers based on thecontainer offsets; for each container of the plurality of containers,generating a container mask based on the container mask offset and thecontainer mask length, applying the container mask to the container, andshifting the masked container by the container shift amount; merging theshifted and masked containers using one or more bitwise operations togenerate a packed data unit; storing or transmitting the packed dataunit in association with unpacking instructions that identify portionsof the packed data unit that map to specific fields in the master set offields.

In at least some of the above embodiments, the descriptive metadatafurther specifies extraction lengths for each of the value fields,wherein the unpacking instructions also specify the extraction lengths.

In at least some of the above embodiments, the unpacking instructionsindicate, for a given field of the specific fields, a specific subset ofbits of the given field that a given portion of the packed data unitcorresponds to. In an embodiment, the specific subset of bits does notinclude the lower and upper bits of the given field, and the packed dataunit does not include data corresponding to the lower and upper bits ofthe given field.

In at least some of the above embodiments, there are more containersthan there are valid fields for a given compression profile.

In at least some of the above embodiments, the method further comprisesprocessing each container in parallel.

In at least some of the above embodiments, the method further comprises,based on a first vector and a second vector being associated withdifferent descriptive metadata, associating the first vector with afirst compression profile and associating the second vector with asecond compression profile that is different from the first profile.

According to some embodiments, an apparatus comprises: a data unpackercomponent configured to receive packed field data for packed data units,unpack the packed data units into field data for fields in a master setof fields based on compression profiles associated with the packed dataunits, and output the unpacked field data, each of the compressionprofiles indicating a specific combination of value-carrying fields inthe master set of fields, and specifying packed value lengths for theindicated value-carrying fields, the packed field data for a given dataunit of the packed data units including values only for the specificcombination of value-carrying fields indicated by a given compressionprofile associated with the given data unit, the values extracted basedon field location information indicated by the given compression profileand corresponding packed value lengths specified by the givencompression profile.

According to some embodiments, an apparatus comprises: a data unpackercomponent configured to unpack at least portions of data unitsrepresented by packed field data, each of the data units having valuesfor one or more fields in a master set of fields, the data unpackercomponent comprising: an input configured to receive particular packedfield data for a particular data unit, of the data units; an inputconfigured to receive particular compression profile informationassociated with the particular data unit; profile processing logicconfigured to, based on the particular compression profile informationassociated with the particular data unit, identify for which particularone or more fields, in the master set of fields, the particular packedfield data stores values; parsing logic configured to extract valuesfrom the particular packed field data for the particular one or morefields that the profile processing logic identifies; outputs, eachoutput of the outputs corresponding to a different field in the masterset of fields and configured to, responsive to the parsing logicextracting a particular value for the field corresponding to the output,output data based on the particular value.

In at least some of the above embodiments, the data output based on theparticular value is the particular value, includes the particular value,represents the particular value, or is a function of the particularvalue.

In at least some of the above embodiments, the parsing logic isconfigured to extract multiple particular values for a particular fieldcorresponding to a particular output, wherein the particular output isconfigured to output field data that includes the multiple particularvalues at locations specified by the particular compression profileinformation.

In at least some of the above embodiments, the apparatus furthercomprises: a profile selection component, coupled to the data unpackercomponent, and configured to: receive a particular compression profileindex in coordination with the data unpacker component receiving theparticular packed field data, the particular compression profile indexbeing associated with the particular data unit; locate a particularcompression profile associated with the particular compression profileindex in an array of compression profiles; and output the particularcompression profile information to the data unpacker component based onthe particular compression profile.

In at least some of the above embodiments, the apparatus furthercomprises: a memory storing a packed data array, the packed data arraycomprising an entry for each data unit of the data units, the entryincluding specific packed field data for the data unit and either acompression profile corresponding to the compression profile informationor an index that references the compression profile, wherein the dataunpacker component is coupled to the memory.

In at least some of the above embodiments, at least a first data unit ofthe data units processed by the data unpacker is represented by firstpacked field data that has values for a different combination of fieldsthan second packed field data that represents a second data unit of thedata units; and/or for at least a first subset of the data units, thedata unpacker component is configured to receive different particularcompression profile information for different particular data units;and/or for at least a second subset of the data units, the data unpackercomponent is further configured to receive the same particularcompression profile information.

In at least some of the above embodiments, the particular compressionprofile information indicates locations of the particular one or morefields in the particular packed field data; and the parsing logic isconfigured to extract the values from the particular packed field databased on the indicated locations and length information for eachrespective field of the particular one or more fields.

In at least some of the above embodiments, the particular compressionprofile information indicates locations of the particular one or morefields in the particular packed field data and packed length informationfor each respective field of the particular one or more fields; and theparsing logic is configured to extract the values from the particularpacked field data based on the indicated locations and the packed lengthinformation.

In at least some of the above embodiments, the particular compressionprofile information specifies packed lengths for the particular one ormore fields, the particular one or more fields including at least twofields for which the particular compression profile informationspecifies different packed lengths; and the parsing logic is configuredto extract a value for a given field from the particular packed fielddata by extracting a number of bits equal to a given packed length, ofthe specified packed lengths, that was specified for the given field.

In at least some of the above embodiments, the data unpacker componentis further configured to convert the extracted values into formatsexpected for data outputted by the outputs.

In at least some of the above embodiments, the data unpacker componentis further configured to pad the extracted values to fixed lengthsrequired for data outputted by the outputs.

In at least some of the above embodiments, the data unpacker componentis further configured to pad at least a particular extracted value witha value specified by the particular compression profile.

In at least some of the above embodiments, based on data in theparticular compression profile, the data unpacker component is furtherconfigured to shift a first subportion of a particular extracted valuerelative to a second subportion of the particular extracted values.

In at least some of the above embodiments, the data unpacker is furtherconfigured to extract values and pad the extracted values by performingone or more shift operations and one or more mask operations.

In at least some of the above embodiments, the particular compressionprofile information comprises an entry for each field in the master setof fields, the entry indicating at least whether the corresponding dataunit has a value for the corresponding field, and the packed length ofthat value within the packed field data for the field.

In at least some of the above embodiments, the particular compressionprofile information corresponds to a selected compression profile, theapparatus further comprises a memory storing a plurality of compressionprofiles from which the selected compression profile is selected, andthe selected compression profile indicates that any packed field dataassociated with the selected compression profile carries values for theparticular one or more fields, wherein a second compression profileindicates that any packed field data associated with the secondcompression profile carries values for a second one or more fields thatis different than the particular one or more fields.

In at least some of the above embodiments, the particular compressionprofile information corresponds to a selected compression profile, andthe apparatus further comprises a memory storing a plurality ofcompression profiles from which the selected compression profile isselected, wherein the parsing logic is configured to extract a value fora given field based on a packed length specified by the particularcompression profile information, the selected compression profilespecifies a first packed length for a first field in the master set, anda second compression profile of the plurality of compression profilesspecifies a second packed length for the first field.

In at least some of the above embodiments, the apparatus is a networkingapparatus and the data unpacker component is implemented by a FieldProgrammable Gate Array or Application Specific Integrated Circuitwithin the networking apparatus.

In at least some of the above embodiments, each output of the outputs isconfigured to output a null or empty value when the compression profileindicates that the packed field data does not include a value for thefield corresponding to the output. In at least some of the aboveembodiments, each output of the outputs is configured to output avalidity bit, indicating whether or not the field mapped to the outputis value-carrying for the currently processed data unit.

In at least some of the above embodiments, the input configured toreceive particular packed field data and the input configured to receivecompression profile information are a same input configured to receive adata structure comprising the compression profile information in a firstset of bits and the particular packed field data in a second set ofbits.

In at least some of the above embodiments, the apparatus furthercomprises: a fixed field filtering component comprising: an inputconfigured to receive a packed representation of the particular dataunit, the packed representation including at least the packed field dataand a fixed number of bits corresponding to one or more fields of theparticular data unit that have not been packed within the particularpacked field data; filtering logic configured to extract the fixednumber of bits from the packed representation; an output configured tooutput the fixed number of bits to another component; and a separateoutput configured to output at least the packed field data to the dataunpacker component.

In at least some of the above embodiments, the data units are a firstset of data units, the master set of fields is a first master set offields, and the apparatus further comprises another data unpackercomponent configured to unpack a second set of data units, each dataunit in the second set of data units having values for one or morefields in a second master set of fields that is different from the firstmaster set of fields.

In at least some of the above embodiments, the parsing logic isconfigured to extract the values in multiple stages, each stagecorresponding to a different subset of the master set of fields.

In at least some of the above embodiments, the apparatus furthercomprises: multiple data unpacker components, each configured to unpacka different portion of the particular data unit.

In at least some of the above embodiments, the data unpacker componentis a first data unpacker component, and the apparatus further comprisesa second data unpacker component configured to unpack a nested packeddata unit that is outputted by one of the outputs of the first dataunpacker component, the nested packed data unit associated withdifferent compression profile information than the particularcompression profile information.

In at least some of the above embodiments, the apparatus furthercomprises: a profiler component configured to identify and/or generatecompression profiles, including a particular compression profilecorresponding to the particular compression profile information, basedon the data units; and a data packer component configured to generateand store the packed field data based on the compression profiles andthe data units.

In at least some of the above embodiments, the particular compressionprofile information indicates that the particular value extracted for agiven field maps to a specific subset of bits of the given field, and agiven output outputs the particular value at the specific subset ofbits. In an embodiment, the specific subset of bits does not include thelower and upper bits of the given field, and the packed data unit doesnot include data corresponding to the lower and upper bits of the givenfield.

According to some embodiments, a method comprises: for each particulardata unit of a plurality of data units, each particular data unit havingvalues for one or more fields in a master set of fields and beingassociated with a particular compression profile of a plurality ofcompression profiles: receiving particular packed field data for theparticular data unit; receiving particular compression profileinformation corresponding to the particular compression profileassociated with the particular data unit; based on the particularcompression profile information associated with the particular dataunit, identifying for which particular one or more fields, in the masterset of fields, the particular packed field data stores values;extracting values from the particular packed field data for theparticular one or more fields that have values in the packed field data;for each field of the particular one or more fields, outputting databased on a particular value extracted from the packed field data for thefield.

In at least some of the above embodiments, the data output based on theparticular value is the particular value, includes the particular value,represents the particular value, or is a function of the particularvalue.

In at least some of the above embodiments, the method comprisesextracting multiple particular values for a particular field, andoutputting field data that includes the multiple particular values atlocations specified by the particular compression profile information.

In some of the embodiments, the method further comprises: receiving aparticular compression profile index associated with the particular dataunit; and based on the particular compression profile index, locatingthe particular compression profile in an array of the plurality ofcompression profiles.

In at least some of the above embodiments, at least a first data unit ofthe plurality of data units is represented by first packed field datathat has values for a different combination of fields than second packedfield data that represents a second data unit of the plurality of dataunits; and/or different particular compression profile information isassociated with at least each first data unit in a first subset of theplurality of data units; and/or the same particular compression profileinformation is associated with at least each second data unit in asecond subset of the plurality of data units.

In at least some of the above embodiments, the particular compressionprofile information indicates locations of the particular one or morefields in the particular packed field data and packed length informationfor each respective field of the particular one or more fields; whereinextracting the values from the particular packed field data is based onthe indicated locations and the packed length information.

In at least some of the above embodiments, the method further comprises:padding the extracted values to fixed lengths expected for thecorresponding fields for which the values were extracted.

In at least some of the above embodiments, padding the extracted valuescomprises inserting extra zeros into a particular field to reach aparticular fixed length or inserting a fixed bit pattern into theparticular field to reach the particular fixed length.

In at least some of the above embodiments, the particular compressionprofile indicates that any packed field data associated with theparticular compression profile carries values for the particular one ormore fields, wherein a second compression profile indicates that anypacked field data associated with the second compression profile carriesvalues for a second one or more fields that is different than theparticular one or more fields.

In at least some of the above embodiments, extracting a value for agiven field is based on a packed length specified by the particularcompression profile information; and the particular compression profilespecifies a first packed length for a first field in the master set,wherein a second compression profile of the plurality of compressionprofiles specifies a second packed length for the first field.

In at least some of the above embodiments, the method further comprises:receiving a packed representation of the particular data unit, thepacked representation including at least the packed field data and afixed number of bits corresponding to one or more fields of theparticular data unit that have not been packed within the particularpacked field data; and separating the fixed number of bits from thepacked representation and outputting the fixed number of bits as one ormore fixed fields prior to identifying the particular one or more fieldsfrom the particular compression profile information.

In at least some of the above embodiments, the method further comprises:identifying and/or generate compression profiles, including theparticular compression profile, based on the plurality of data units;and generating and store packed field data for the plurality of dataunits based on the compression profiles and the data units.

In at least some of the above embodiments, the method is repeated withrespect to a nested data unit packed inside of a first field of theparticular data unit.

According to some embodiments, a method comprises identifying and/orgenerating compression profiles, based on the plurality of data units;and generating and storing packed field data for the plurality of dataunits based on the compression profiles and the data units.

Other examples of these and other embodiments are found throughout thisdisclosure.

6.0. Implementation Mechanism—Hardware Overview

According to one embodiment, the techniques described herein areimplemented by one or more special-purpose computing devices. Thespecial-purpose computing devices may be desktop computer systems,portable computer systems, handheld devices, networking devices, or anyother device that incorporates hard-wired and/or program logic toimplement the techniques. The special-purpose computing devices may behard-wired to perform the techniques, or may include digital electronicdevices such as one or more application-specific integrated circuits(ASICs) or field programmable gate arrays (FPGAs) that are persistentlyprogrammed to perform the techniques. Such special-purpose computingdevices may also combine custom hard-wired logic, ASICs, or FPGAs withcustom programming to accomplish the techniques.

Though the foregoing techniques are described with respect to a hardwareimplementation, which provides a number of advantages in certainembodiments, it will also be recognized that, in another embodiment, theforegoing techniques may still provide certain advantages when performedpartially or wholly in software. Accordingly, in such an embodiment, asuitable implementing apparatus comprises a general-purpose hardwareprocessor and is configured to perform any of the foregoing methods byexecuting program instructions in firmware, memory, other storage, or acombination thereof.

FIG. 13 is a block diagram that illustrates a computer system 1300 thatmay be utilized in implementing the above-described techniques,according to an embodiment. Computer system 1300 may be, for example, adesktop computing device, laptop computing device, tablet, smartphone,server appliance, computing mainframe, multimedia device, handhelddevice, networking apparatus, or any other suitable device.

Computer system 1300 may include one or more ASICs, FPGAs, or otherspecialized circuitry 1303 for implementing program logic as describedherein. Additionally, and/or instead, computer system 1300 may includeone or more hardware processors 1304. Computer system 1300 may alsoinclude one or more busses 1302 or other communication mechanism forcommunicating information. Busses 1302 may include various internaland/or external components, including, without limitation, internalprocessor or memory busses, a Serial ATA bus, a PCI Express bus, aUniversal Serial Bus, a HyperTransport bus, an Infiniband bus, and/orany other suitable wired or wireless communication channel.

Computer system 1300 also includes one or more memories 1306, such as arandom access memory (RAM), registers, or other dynamic or volatilestorage device for storing data units to be processed by the one or moreASICs, FPGAs, or other specialized circuitry 1303. Memory 1306 may alsoor instead be used for storing information and instructions to beexecuted by processor 1304. Memory 1306 may be directly connected orembedded within circuitry 1303 or a processor 1304. Or, memory 1306 maybe coupled to and accessed via bus 1302. Memory 1306 also may be usedfor storing temporary variables, data units describing rules orpolicies, or other intermediate information during execution of programlogic or instructions.

Computer system 1300 further includes one or more read only memories(ROM) 1308 or other static storage devices coupled to bus 1302 forstoring static information and instructions for processor 1304. One ormore storage devices 1310, such as a solid-state drive (SSD), magneticdisk, optical disk, or other suitable non-volatile storage device, mayoptionally be provided and coupled to bus 1302 for storing informationand instructions.

A computer system 1300 may also include, in an embodiment, one or morecommunication interfaces 1318 coupled to bus 1302. A communicationinterface 1318 provides a data communication coupling, typicallytwo-way, to a network link 1320 that is connected to a local network1322. For example, a communication interface 1318 may be an integratedservices digital network (ISDN) card, cable modem, satellite modem, or amodem to provide a data communication connection to a corresponding typeof telephone line. As another example, the one or more communicationinterfaces 1318 may include a local area network (LAN) card to provide adata communication connection to a compatible LAN. As yet anotherexample, the one or more communication interfaces 1318 may include awireless network interface controller, such as a 802.11-basedcontroller, Bluetooth controller, Long Term Evolution (LTE) modem,and/or other types of wireless interfaces. In any such implementation,communication interface 1318 sends and receives electrical,electromagnetic, or optical signals that carry digital data streamsrepresenting various types of information.

Network link 1320 typically provides data communication through one ormore networks to other data devices. For example, network link 1320 mayprovide a connection through local network 1322 to a host computer 1324or to data equipment operated by a Service Provider 1326. ServiceProvider 1326, which may for example be an Internet Service Provider(ISP), in turn provides data communication services through a wide areanetwork, such as the world wide packet data communication network nowcommonly referred to as the “Internet” 1328. Local network 1322 andInternet 1328 both use electrical, electromagnetic or optical signalsthat carry digital data streams. The signals through the variousnetworks and the signals on network link 1320 and through communicationinterface 1318, which carry the digital data to and from computer system1300, are example forms of transmission media.

In an embodiment, computer system 1300 can send messages and receivedata through the network(s), network link 1320, and communicationinterface 1318. In some embodiments, this data may be data units thatthe computer system 1300 has been asked to process and, if necessary,redirect to other computer systems via a suitable network link 1320. Inother embodiments, this data may be instructions for implementingvarious processes related to the described techniques. For instance, inthe Internet example, a server 1330 might transmit a requested code foran application program through Internet 1328, ISP 1326, local network1322 and communication interface 1318. The received code may be executedby processor 1304 as it is received, and/or stored in storage device1310, or other non-volatile storage for later execution. As anotherexample, information received via a network link 1320 may be interpretedand/or processed by a software component of the computer system 1300,such as a web browser, application, or server, which in turn issuesinstructions based thereon to a processor 1304, possibly via anoperating system and/or other intermediate layers of softwarecomponents.

Computer system 1300 may optionally be coupled via bus 1302 to one ormore displays 1312 for presenting information to a computer user. Forinstance, computer system 1300 may be connected via an High-DefinitionMultimedia Interface (HDMI) cable or other suitable cabling to a LiquidCrystal Display (LCD) monitor, and/or via a wireless connection such aspeer-to-peer Wi-Fi Direct connection to a Light-Emitting Diode (LED)television. Other examples of suitable types of displays 1312 mayinclude, without limitation, plasma display devices, projectors, cathoderay tube (CRT) monitors, electronic paper, virtual reality headsets,braille terminal, and/or any other suitable device for outputtinginformation to a computer user. In an embodiment, any suitable type ofoutput device, such as, for instance, an audio speaker or printer, maybe utilized instead of a display 1312.

One or more input devices 1314 are optionally coupled to bus 1302 forcommunicating information and command selections to processor 1304. Oneexample of an input device 1314 is a keyboard, including alphanumericand other keys. Another type of user input device 1314 is cursor control1316, such as a mouse, a trackball, or cursor direction keys forcommunicating direction information and command selections to processor1304 and for controlling cursor movement on display 1312. This inputdevice typically has two degrees of freedom in two axes, a first axis(e.g., x) and a second axis (e.g., y), that allows the device to specifypositions in a plane. Yet other examples of suitable input devices 1314include a touch-screen panel affixed to a display 1312, cameras,microphones, accelerometers, motion detectors, and/or other sensors. Inan embodiment, a network-based input device 1314 may be utilized. Insuch an embodiment, user input and/or other information or commands maybe relayed via routers and/or switches on a Local Area Network (LAN) orother suitable shared network, or via a peer-to-peer network, from theinput device 1314 to a network link 1320 on the computer system 1300.

As discussed, computer system 1300 may implement techniques describedherein using customized hard-wired logic, one or more ASICs or FPGAs1303, firmware and/or program logic, which in combination with thecomputer system causes or programs computer system 1300 to be aspecial-purpose machine. According to one embodiment, however, thetechniques herein are performed by computer system 1300 in response toprocessor 1304 executing one or more sequences of one or moreinstructions contained in main memory 1306. Such instructions may beread into main memory 1306 from another storage medium, such as storagedevice 1310. Execution of the sequences of instructions contained inmain memory 1306 causes processor 1304 to perform the process stepsdescribed herein.

The term “storage media” as used herein refers to any non-transitorymedia that store data and/or instructions that cause a machine tooperate in a specific fashion. Such storage media may comprisenon-volatile media and/or volatile media. Non-volatile media includes,for example, optical or magnetic disks, such as storage device 1310.Volatile media includes dynamic memory, such as main memory 1306. Commonforms of storage media include, for example, a floppy disk, a flexibledisk, hard disk, solid state drive, magnetic tape, or any other magneticdata storage medium, a CD-ROM, any other optical data storage medium,any physical medium with patterns of holes, a RAM, a PROM, and EPROM, aFLASH-EPROM, NVRAM, any other memory chip or cartridge.

Storage media is distinct from but may be used in conjunction withtransmission media. Transmission media participates in transferringinformation between storage media. For example, transmission mediaincludes coaxial cables, copper wire and fiber optics, including thewires that comprise bus 1302. Transmission media can also take the formof acoustic or light waves, such as those generated during radio-waveand infra-red data communications.

Various forms of media may be involved in carrying one or more sequencesof one or more instructions to processor 1304 for execution. Forexample, the instructions may initially be carried on a magnetic disk orsolid state drive of a remote computer. The remote computer can load theinstructions into its dynamic memory and use a modem to send theinstructions over a network, such as a cable network or cellularnetwork, as modulated signals. A modem local to computer system 1300 canreceive the data on the network and demodulate the signal to decode thetransmitted instructions. Appropriate circuitry can then place the dataon bus 1302. Bus 1302 carries the data to main memory 1306, from whichprocessor 1304 retrieves and executes the instructions. The instructionsreceived by main memory 1306 may optionally be stored on storage device1310 either before or after execution by processor 1304.

7.0. Extensions and Alternatives

As used herein, the terms “first,” “second,” “certain,” and “particular”are used as naming conventions to distinguish queries, plans,representations, steps, objects, devices, or other items from eachother, so that these items may be referenced after they have beenintroduced. Unless otherwise specified herein, the use of these termsdoes not imply an ordering, timing, or any other characteristic of thereferenced items.

In the drawings, the various components are depicted as beingcommunicatively coupled to various other components by arrows. Thesearrows illustrate only certain examples of information flows between thecomponents. Neither the direction of the arrows nor the lack of arrowlines between certain components should be interpreted as indicating theexistence or absence of communication between the certain componentsthemselves. Indeed, each component may feature a suitable communicationinterface by which the component may become communicatively coupled toother components as needed to accomplish any of the functions describedherein.

In the foregoing specification, embodiments of the invention have beendescribed with reference to numerous specific details that may vary fromimplementation to implementation. Thus, the sole and exclusive indicatorof what is the invention, and is intended by the applicants to be theinvention, is the set of claims that issue from this application, in thespecific form in which such claims issue, including any subsequentcorrection. In this regard, although specific claim dependencies are setout in the claims of this application, it is to be noted that thefeatures of the dependent claims of this application may be combined asappropriate with the features of other dependent claims and with thefeatures of the independent claims of this application, and not merelyaccording to the specific dependencies recited in the set of claims.Moreover, although separate embodiments are discussed herein, anycombination of embodiments and/or partial embodiments discussed hereinmay be combined to form further embodiments.

Any definitions expressly set forth herein for terms contained in suchclaims shall govern the meaning of such terms as used in the claims.Hence, no limitation, element, property, feature, advantage or attributethat is not expressly recited in a claim should limit the scope of suchclaim in any way. The specification and drawings are, accordingly, to beregarded in an illustrative rather than a restrictive sense.

What is claimed is:
 1. An apparatus comprising: one or more memoriesstoring compression profiles that indicate different extraction lengthsand extraction offsets for fields in a master set of fields; a vectorprofiler component configured to input vectors having portions allocatedto different fields in the master set, and to output associatedcompression profiles selected for the inputted vectors, a givencompression profile selected for a given vector based at least on forwhich of the different fields in the master set the given vector carriesvalues; a data packing component configured to input the vectors and theassociated compression profiles, and to output packed vectors generatedfor the vectors using the associated compression profiles, a givenpacked vector generated from a given vector based on given extractionoffsets and given extraction lengths indicated by a given compressionprofile that was selected for the given vector, the given packed vectoroutputted in association with information identifying the givencompression profile.
 2. The apparatus of claim 1, wherein the datapacking component is configured to generate the given packed vector forthe given vector by extracting amounts of data from the given vector ateach given extraction offset identified by the given compressionsprofile, the amount of data extracted at a given extraction offset equalto an associated given extraction length identified by the givencompression profile for the given extraction offset, and by loading theextracted amounts of data into corresponding target locations within thegiven packed vector.
 3. The apparatus of claim 2, wherein the givencompression profile also indicates which of the target locationscorrespond to which of the extraction offsets and which of theextraction lengths.
 4. The apparatus of claim 2, wherein loading theextracted amounts of data into corresponding target locations comprisesperforming one or more shift operations on the given vector, one or moremask operations on the given vector, and one or more bitwise operationsto merge the packed vector with a result of the one or more shiftoperations and the one or more mask operations.
 5. The apparatus ofclaim 2, wherein the data packing component is configured to performsaid loading in parallel for at least two of the value-carrying fields.6. The apparatus of claim 2, wherein the given compression profileindicates, for a given field, multiple pairs of extraction offsets andassociated extraction lengths, the method comprising extracting acorresponding amount of data from each of the extraction offsets in saidpairs.
 7. The apparatus of claim 1, further comprising one or morememories configured to store one or more arrays of the packed vectorsoutputted by the data packing component.
 8. The apparatus of claim 1,wherein the vector profiler component is further configured to selectthe given compression profile for the given vector based on identifyinglengths of the values carried by the given vector for specific fieldswithin the master set.
 9. The apparatus of claim 1, wherein the vectorprofiler component is configured to associate different vectors of aplurality of the vectors with different compression profiles, thedifferent compression profiles specifying different extraction lengthsfor a same field.
 10. The apparatus of claim 1, wherein the vectorprofiler component is configured to associate different vectors of thevectors with different compression profiles, the different compressionprofiles indicating that, for a first subset of the vectors that isassociated with a first profile of the different compression profiles, afirst set of fields are value-carrying, and that for a second subset ofthe vectors that is associated with a second profile of the differentcompression profiles, a second and different set of fields arevalue-carrying.
 11. The apparatus of claim 1, wherein the apparatus is anetworking apparatus and the data packing component is implemented by aField Programmable Gate Array or Application Specific Integrated Circuitwithin the networking apparatus.
 12. The apparatus of claim 1, furthercomprising multiple data packing components configured to generate apacked data unit using a sequence of stages, the packed vector output byone of the stages being passed as input to a next stage of the stages.13. The apparatus of claim 1, wherein the vector profiler component isconfigured to generate a new compression profile to associate with aparticular vector when none of the compressions profiles is determinedto be suitable for the particular vector.
 14. The apparatus of claim 1,wherein the vector profiler component is configured to receivedescriptive metadata associated with the given vector, wherein selectingthe given compression profile comprises matching the descriptivemetadata to the given compression profile.
 15. An apparatus comprising:one or more memories storing compression profiles, each compressionprofile defining a plurality of containers and identifying, for eachcontainer of the plurality of containers, a container offsetcorresponding to the location of the container in a vector, a containershift amount, a container mask start offset, and a container masklength; a vector profiler component configured to input vectors havingportions allocated to different fields in a master set of fields, and tooutput associated compression profiles selected for the inputtedvectors, a given compression profile selected for a given vector basedat least on for which of the different fields in the master set thegiven vector carries values; one or more data packing componentsconfigured to input the vectors and the associated compression profiles,and to output packed vectors generated for the vectors using theassociated compression profiles, a given packed vector generated from agiven vector based on given container offsets, given container shiftamounts, given container mask start offsets, and given container masklengths indicated by a given compression profile that was selected forthe given vector, the given packed vector outputted in association withinformation identifying the given compression profile.
 16. The apparatusof claim 15, wherein the one or more data packing components areconfigured to generate the given packed vector for the given vector by:dividing the given vector into containers based on the given containeroffsets; for each container of the containers, generating a containermask based on the given container mask offset and the given containermask length, applying the container mask to the container, and shiftingthe masked container by the given container shift amount; merging theshifted and masked containers using one or more bitwise operations. 17.The apparatus of claim 16, wherein the one or more data packingcomponents include a plurality of data packing components configured toprocess each of the containers in parallel.
 18. The apparatus of claim17, wherein the vector profiler component is further configured toselect the associated compression profiles based on descriptive metadataassociated with the vectors, wherein the descriptive metadata specifiesextraction lengths for each of the value-carrying fields in a givenvector, wherein a given compression profile comprises unpackinginstructions that specify the extraction lengths that correspond to thegiven compression profile.
 19. The apparatus of claim 17, wherein thevector profiler component is configured to, based on a first vector anda second vector being associated with different descriptive metadata,associate a first vector with a first compression profile and associatea second vector with a second compression profile that is different fromthe first compression profile.
 20. The apparatus of claim 15, furthercomprising one or more memories configured to store one or more arraysof the packed vectors outputted by the one or more data packingcomponents.